summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-03-15 19:43:36 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-03-16 10:27:08 +0000
commite41d23abb03a0c5a5c50be290c2265513e178889 (patch)
treea3aeab7502c2073d7f6c5f89598512c5108f735a /sw/source/uibase
parenteca17faebdeb1a1dc305ffc9273e533eb880d4da (diff)
tdf#84953 Only resize proportionally when dragging on a corner
Change-Id: Iec4eda867216575e058fa673788d9345da05c872 Reviewed-on: https://gerrit.libreoffice.org/23291 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx17
1 files changed, 11 insertions, 6 deletions
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);
}