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-03-04 14:45:49 +0000 |
commit | d0244e043c1aca4a9e63313998254202e40f113b (patch) | |
tree | 314bb0d795a4528f158ef38023c42e087ef7b107 /cppcanvas | |
parent | 5bdbf99c3ec6e5e0793c52c34ff4f3a17afab107 (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>
(cherry picked from commit 1c85800345239754d5c4ec71c2aad526d0439eea)
Reviewed-on: https://gerrit.libreoffice.org/22889
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'cppcanvas')
-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 9d75134a38cb..4c98a198ed63 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> @@ -381,6 +382,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 = |