From e57053c435c4ccd8375904b22e6e0a40f149b346 Mon Sep 17 00:00:00 2001 From: Christian Lippka ORACLE Date: Tue, 6 Dec 2011 03:43:48 +0100 Subject: impress210: #i41995# using view contact to get bound rect for old path animation import # HG changeset patch # User Christian Lippka ORACLE # Date 1301475461 -7200 # Node ID d87b5924442237c58b243d83012f655ce59c312d # Parent c6dff567a9e0ee383071e53c64e3f5a06a186015 impress210: #i41995# using view contact to get bound rect for old path animation import --- sd/source/core/CustomAnimationEffect.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 7deb7cfa0ed9..47b47d126c11 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -69,6 +69,8 @@ #include +#include +#include #include #include #include @@ -1735,8 +1737,19 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); if( pObj ) { - pObj->RecalcBoundRect(true); - 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())); -- cgit