diff options
Diffstat (limited to 'slideshow/source')
-rw-r--r-- | slideshow/source/engine/slide/layermanager.cxx | 5 | ||||
-rw-r--r-- | slideshow/source/engine/slideview.cxx | 25 | ||||
-rw-r--r-- | slideshow/source/inc/viewlayer.hxx | 3 |
3 files changed, 33 insertions, 0 deletions
diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index 91bdb7bb81ac..bbe45787836f 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -636,6 +636,11 @@ namespace slideshow OSL_FAIL( "BitmapView::setPriority(): This method is not supposed to be called!" ); } + virtual ::com::sun::star::geometry::IntegerSize2D getTranslationOffset() const + { + return geometry::IntegerSize2D(0,0); + } + virtual ::basegfx::B2DHomMatrix getTransformation() const { return mpCanvas->getTransformation(); diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index 250de4e9efd3..db2e471e855c 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -489,6 +489,25 @@ public: } } + virtual ::com::sun::star::geometry::IntegerSize2D getTranslationOffset() const + { + std::cerr << "slideshow/source/engine/slideview.cxx:522" << std::endl; + basegfx::B2DRectangle aTmpRect; + canvas::tools::calcTransformedRectBounds( aTmpRect, + maLayerBounds, + maTransformation ); + geometry::IntegerSize2D offset(0, 0); + + // Add translation according to the origin of aTmpRect. Ignore the + // translation when aTmpRect was not properly initialized. + if ( ! aTmpRect.isEmpty()) + { + offset.Width = basegfx::fround(aTmpRect.getMinX()); + offset.Height = basegfx::fround(aTmpRect.getMinY()); + } + return offset; + } + private: // ViewLayer interface // ---------------------------------------------- @@ -700,6 +719,7 @@ private: virtual cppcanvas::CustomSpriteSharedPtr createSprite( const ::basegfx::B2DSize& rSpriteSizePixel, double nPriority ) const; virtual void setPriority( const basegfx::B1DRange& rRange ); + virtual geometry::IntegerSize2D getTranslationOffset() const; virtual ::basegfx::B2DHomMatrix getTransformation() const; virtual basegfx::B2DHomMatrix getSpriteTransformation() const; virtual void setClip( const ::basegfx::B2DPolyPolygon& rClip ); @@ -960,6 +980,11 @@ basegfx::B2DHomMatrix SlideView::getTransformation() const return maViewTransform * aMatrix; } +geometry::IntegerSize2D SlideView::getTranslationOffset() const +{ + return mxView->getTranslationOffset(); +} + basegfx::B2DHomMatrix SlideView::getSpriteTransformation() const { return getTransformation(); diff --git a/slideshow/source/inc/viewlayer.hxx b/slideshow/source/inc/viewlayer.hxx index bddb2102eaf8..f47f18aaa96b 100644 --- a/slideshow/source/inc/viewlayer.hxx +++ b/slideshow/source/inc/viewlayer.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> #include <boost/shared_ptr.hpp> +#include <com/sun/star/geometry/IntegerSize2D.hpp> namespace basegfx { @@ -128,6 +129,8 @@ namespace slideshow */ virtual basegfx::B2DHomMatrix getTransformation() const = 0; + virtual ::com::sun::star::geometry::IntegerSize2D getTranslationOffset() const = 0; + /** Get the overall view transformation. Same transformation as with getTransformation(), only |