diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-11-10 23:28:19 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-13 16:36:12 +0100 |
commit | 11e6f0d7e1b92ace72ab626ad293c43f4c7407ee (patch) | |
tree | 0de5b996be11b32deb73167b45b589e58b4fc25a /slideshow | |
parent | 9a1ffec3207a0e4282d8033a657690363762b9fe (diff) |
slideshow: clip shapes in secondary screen window
When using the presenter console, the secondary screen has
a small view of the current slide.
Currently nothing clips the shapes that are on the slide,
so they may be rendered outside the slide rectangle,
because there's a single VCL-canvas and OutPutDevice that covers
the entire screen.
Set up some brute force clipping in DrawShape::getViewRenderArgs().
Change-Id: I3b21f08c12718254b6cf166b7fb1540e9381b243
(cherry picked from commit 99e373cd4c78084ded349f3e3de7b0504af2dd90)
Reviewed-on: https://gerrit.libreoffice.org/44613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/shapes/drawshape.cxx | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index 98f1cae40ac7..b1dc56b62741 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -134,11 +134,26 @@ namespace slideshow ViewShape::RenderArgs DrawShape::getViewRenderArgs() const { + uno::Reference<beans::XPropertySet> const xPropSet(mxPage, + uno::UNO_QUERY_THROW); + sal_Int32 nWidth = 0; + sal_Int32 nHeight = 0; + xPropSet->getPropertyValue("Width") >>= nWidth; + xPropSet->getPropertyValue("Height") >>= nHeight; + basegfx::B2DRectangle slideRect(0, 0, nWidth, nHeight); + basegfx::B2DRectangle origBounds(maBounds); + origBounds.intersect(slideRect); + basegfx::B2DRectangle updateBounds(getUpdateArea()); + updateBounds.intersect(slideRect); + basegfx::B2DRectangle bounds(getBounds()); + bounds.intersect(slideRect); + basegfx::B2DRectangle unitBounds(getActualUnitShapeBounds()); + unitBounds.intersect(slideRect); return ViewShape::RenderArgs( - maBounds, - getUpdateArea(), - getBounds(), - getActualUnitShapeBounds(), + origBounds, + updateBounds, + bounds, + unitBounds, mpAttributeLayer, maSubsetting.getActiveSubsets(), mnPriority); |