summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorChristian Lippka ORACLE <christian.lippka@oracle.com>2011-12-06 03:43:48 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-12-06 09:39:16 +0100
commite57053c435c4ccd8375904b22e6e0a40f149b346 (patch)
treeb9e6b6858e332d8e5893ac46a8af7bc543cf00c5 /sd
parentf44ed1142d24c2e0adeff039c626f2074c3dab87 (diff)
impress210: #i41995# using view contact to get bound rect for old path animation import
# HG changeset patch # User Christian Lippka ORACLE <christian.lippka@oracle.com> # Date 1301475461 -7200 # Node ID d87b5924442237c58b243d83012f655ce59c312d # Parent c6dff567a9e0ee383071e53c64e3f5a06a186015 impress210: #i41995# using view contact to get bound rect for old path animation import
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx17
1 files changed, 15 insertions, 2 deletions
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 <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>
@@ -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()));