diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-09-29 12:35:44 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-20 14:13:24 +0200 |
commit | 93f5800e181372d3e5f02c825fd3b09f2756cac7 (patch) | |
tree | 2771a723cd2f23258fc7402bd3da40b05c5ec079 /sw/source | |
parent | 73360bdf0b60370c76d9669502c2b0e5a9d4e504 (diff) |
RotGrfFlyFrame: Corrected position for CropHandles
Position was taken from OuterBound FlyFrame, even in current
master which is wrong. There can be a distance defined between
InnerBound and OuterBound that has to be taken into account
Change-Id: Id88f99c0b218bd26fa1daa5e8215eced00c0baa6
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 358085bd2760..6a21d0eb9d71 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -48,6 +48,7 @@ #include "pagefrm.hxx" #include "rootfrm.hxx" #include "wrtsh.hxx" +#include <ndgrf.hxx> #include <svx/sdr/properties/defaultproperties.hxx> #include <basegfx/range/b2drange.hxx> @@ -958,10 +959,10 @@ SdrObject* SwVirtFlyDrawObj::getFullDragClone() const if(0 != nRotation) { const double fRotate(static_cast< double >(-nRotation) * (M_PI/1800.0)); - const tools::Rectangle aOutRect(GetFlyFrame()->Frame().SVRect()); + const tools::Rectangle aTmpOutRect(GetFlyFrame()->Frame().SVRect()); const basegfx::B2DRange aTargetRange( - aOutRect.Left(), aOutRect.Top(), - aOutRect.Right(), aOutRect.Bottom()); + aTmpOutRect.Left(), aTmpOutRect.Top(), + aTmpOutRect.Right(), aTmpOutRect.Bottom()); const basegfx::B2DHomMatrix aTargetTransform( basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange( aTargetRange, @@ -979,10 +980,10 @@ void SwVirtFlyDrawObj::addCropHandles(SdrHdlList& rTarget) const // RotGrfFlyFrame: Adapt to possible rotated Graphic contained in FlyFrame if(GetFlyFrame()->Frame().HasArea()) { - const tools::Rectangle aOutRect(GetFlyFrame()->Frame().SVRect()); - const basegfx::B2DRange aTargetRange( - aOutRect.Left(), aOutRect.Top(), - aOutRect.Right(), aOutRect.Bottom()); + // Use InnerBound, OuterBound (same as GetFlyFrame()->Frame().SVRect()) + // may have a distance to InnerBound which needs to be taken into acocunt. + // The Graphic is mapped to InnerBound, as is the rotated Graphic. + const basegfx::B2DRange aTargetRange(getInnerBound()); if(!aTargetRange.isEmpty()) { |