diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index cdb0ac3a8dd1..f0b86395cc9f 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -297,9 +297,15 @@ bool FuPoor::doConstructOrthogonal() const if (rMarkList.GetMarkCount() == 1) { sal_uInt16 aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); - return aObjIdentifier == OBJ_GRAF || - aObjIdentifier == OBJ_MEDIA || - aObjIdentifier == OBJ_OLE2; + bool bIsMediaSelected = aObjIdentifier == OBJ_GRAF || + aObjIdentifier == OBJ_MEDIA || + aObjIdentifier == OBJ_OLE2; + + SdrHdl* pHdl = pView->PickHandle(aMDPos); + // Resize proportionally when media is selected and the user drags on a corner + if (pHdl) + return bIsMediaSelected && pHdl->IsCornerHdl(); + return bIsMediaSelected; } } else if (aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON || aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON_NOFILL) diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index c1f498967472..b39c56910356 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -1124,23 +1124,26 @@ bool FuPoor::cancel() bool FuPoor::doConstructOrthogonal() const { // Check whether a media object is selected - bool bIsMediaSelected = false; + bool bResizeKeepRatio = false; // tdf#89758 Avoid interactive crop preview from being proportionally scaled by default. if (mpView->AreObjectsMarked() && mpView->GetDragMode() != SDRDRAG_CROP) { const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) { - SdrMark* pMark = rMarkList.GetMark(0); - sal_uInt16 aObjIdentifier = pMark->GetMarkedSdrObj()->GetObjIdentifier(); - bIsMediaSelected = aObjIdentifier == OBJ_GRAF || + sal_uInt16 aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); + bResizeKeepRatio = aObjIdentifier == OBJ_GRAF || aObjIdentifier == OBJ_MEDIA || aObjIdentifier == OBJ_OLE2; } } + SdrHdl* pHdl = mpView->PickHandle(aMDPos); + // Resize proportionally when media is selected and the user drags on a corner + if (pHdl) + bResizeKeepRatio = bResizeKeepRatio && pHdl->IsCornerHdl(); return ( - bIsMediaSelected || + bResizeKeepRatio || SID_DRAW_XLINE == nSlotId || SID_DRAW_CIRCLEARC == nSlotId || SID_DRAW_SQUARE == nSlotId || diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index d7be3c002d8a..ad1263421635 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -4079,29 +4079,34 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( bIsDocReadOnly ) break; - bool bIsMediaSelected = rSh.GetSelectionType() & nsSelectionType::SEL_GRF || + bool bResizeKeepRatio = rSh.GetSelectionType() & nsSelectionType::SEL_GRF || rSh.GetSelectionType() & nsSelectionType::SEL_MEDIA || rSh.GetSelectionType() & nsSelectionType::SEL_OLE; bool bisResize = g_eSdrMoveHdl != HDL_MOVE; + // Resize proportionally when media is selected and the user drags on a corner + const Point aSttPt(PixelToLogic(m_aStartPos)); + SdrHdl* pHdl = pSdrView->PickHandle(aSttPt); + if (pHdl) + bResizeKeepRatio = bResizeKeepRatio && pHdl->IsCornerHdl(); + if (pSdrView) { if (pSdrView->GetDragMode() == SDRDRAG_CROP) bisResize = false; - if (rMEvt.IsShift()) { - pSdrView->SetAngleSnapEnabled(!bIsMediaSelected); + pSdrView->SetAngleSnapEnabled(!bResizeKeepRatio); if (bisResize) - pSdrView->SetOrtho(!bIsMediaSelected); + pSdrView->SetOrtho(!bResizeKeepRatio); else pSdrView->SetOrtho(true); } else { - pSdrView->SetAngleSnapEnabled(bIsMediaSelected); + pSdrView->SetAngleSnapEnabled(bResizeKeepRatio); if (bisResize) - pSdrView->SetOrtho(bIsMediaSelected); + pSdrView->SetOrtho(bResizeKeepRatio); else pSdrView->SetOrtho(false); }