diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-02-26 16:37:32 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-02-28 10:11:16 +0000 |
commit | 1c85800345239754d5c4ec71c2aad526d0439eea (patch) | |
tree | 9e92c7f31d8e917c44c475de6cdf6c76c10564cd /cppcanvas/source | |
parent | 48217c28706d22306d17ab7d73b702389d7545a4 (diff) |
tdf#95709 adapt clip polygon for transparence groups
For presentation transparence groups are rendered by the canvas
using VirtualDevices and Bitmaps. To adapt for then painting
the Bitnmap to the canvas the RenderState needs to be adapted
to e.g. reflect the already applied scaling. Missing was to adapt
a set clip polyPolygon to be synchronized with the new RenderState
transformation.
Change-Id: If760a8076e016a6dcf306db71971f1fd2fef7017
Reviewed-on: https://gerrit.libreoffice.org/22720
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'cppcanvas/source')
-rw-r--r-- | cppcanvas/source/mtfrenderer/transparencygroupaction.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index 52c94b772b2c..a8f61f266256 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -46,6 +46,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/tuple/b2dtuple.hxx> #include <basegfx/tools/canvastools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <boost/noncopyable.hpp> @@ -373,6 +374,15 @@ namespace cppcanvas rendering::RenderState aLocalState( maState ); ::canvas::tools::setRenderStateTransform(aLocalState, aTransform); + if(aLocalState.Clip.is()) + { + // tdf#95709 + // Adjust renderstate clip to modified scale from above + ::basegfx::B2DPolyPolygon aClip = ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(aLocalState.Clip); + aClip.transform(basegfx::tools::createScaleB2DHomMatrix(aScale)); + aLocalState.Clip = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(mpCanvas->getUNOCanvas()->getDevice(), aClip); + } + #if OSL_DEBUG_LEVEL > 2 aLocalState.Clip.clear(); aLocalState.DeviceColor = |