summaryrefslogtreecommitdiffstats
path: root/sd/source/core/CustomAnimationEffect.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/core/CustomAnimationEffect.cxx')
-rwxr-xr-xsd/source/core/CustomAnimationEffect.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 33b9c233909b..9ce0084ddbd3 100755
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -72,6 +72,8 @@
#include <cppuhelper/implbase1.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
#include <svx/unoapi.hxx>
@@ -1738,7 +1740,19 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj
SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() );
if( pObj )
{
- const Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
+ Rectangle aBoundRect(0,0,0,0);
+
+ const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(pObj->GetViewContact().getViewIndependentPrimitive2DSequence());
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
+ const basegfx::B2DRange aRange(drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xPrimitives, aViewInformation2D));
+
+ if(!aRange.isEmpty())
+ {
+ aBoundRect = Rectangle(
+ (sal_Int32)floor(aRange.getMinX()), (sal_Int32)floor(aRange.getMinY()),
+ (sal_Int32)ceil(aRange.getMaxX()), (sal_Int32)ceil(aRange.getMaxY()));
+ }
+
const Point aCenter( aBoundRect.Center() );
xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y()));