diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-11-10 23:28:19 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-11-10 23:53:15 +0100 |
commit | 99e373cd4c78084ded349f3e3de7b0504af2dd90 (patch) | |
tree | 0c1ff8718814ac92ee6f2f766d0c66bf94f32343 | |
parent | 3c18e816c23f1e49a44b12cf7aee10c47af7e2ec (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
-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 00a8894f5ef0..c023119ded06 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -133,11 +133,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); |