diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-04 17:44:24 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-20 14:13:24 +0200 |
commit | 9743ecb42095b6e742ab7636ccc67b820f8b9fee (patch) | |
tree | 75d5949861bd9974ffe6acbc0805b501c76dd2fc /svx/source/svdraw/svddrgmt.cxx | |
parent | 93f5800e181372d3e5f02c825fd3b09f2756cac7 (diff) |
RotGrfFlyFrame: Added interactive rotation mode
The FlyFrames containing a graphic now support an
interactive rotation mode. Added a rotation icon to the
Toolbar close to right/left 90degree rotation. When
activated, works as similar to draw object mode as
possible. Shear and move of the rotation center is
deactivated since not supported. It uses as much of the
existing interaction stuff as possible.
Change-Id: Ia1a4e5c064d8576b114c3fcf3a96ccb42c9372bb
Diffstat (limited to 'svx/source/svdraw/svddrgmt.cxx')
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 3348579bd508..a00528f61af8 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -2097,18 +2097,28 @@ bool SdrDragRotate::BeginSdrDrag() { SdrHdl* pH=GetHdlList().GetHdl(SdrHdlKind::Ref1); - if (pH!=nullptr) + if (nullptr != pH) { Show(); DragStat().Ref1()=pH->GetPos(); nAngle0=GetAngle(DragStat().GetStart()-DragStat().GetRef1()); return true; } - else + + // RotGrfFlyFrame: Support rotation around center *without* Ref1 (normally + // the rotation point) + const tools::Rectangle aLocalMarkRect(getSdrDragView().GetMarkedObjRect()); + + if(!aLocalMarkRect.IsEmpty()) { - OSL_FAIL("SdrDragRotate::BeginSdrDrag(): No reference point handle found."); - return false; + Show(); + DragStat().Ref1() = aLocalMarkRect.Center(); + nAngle0=GetAngle(DragStat().GetStart()-DragStat().GetRef1()); + return true; } + + OSL_FAIL("SdrDragRotate::BeginSdrDrag(): No reference point handle found."); + return false; } basegfx::B2DHomMatrix SdrDragRotate::getCurrentTransformation() |