summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-01-26 08:41:59 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-02-09 09:52:58 +0000
commit60e55044891305756fc3fdbcbd8ddbd592c40df9 (patch)
treed445e94cb0adf2a4f09c8c2387a08eb5b5a18fea /canvas
parente0759e728436052e560285849b30a9ec8a13bef5 (diff)
tdf#105620: Fix placement of image embedded in graphic
Change-Id: I3d399fe4aab9260817f171d4e69388a19eb85d21 Reviewed-on: https://gerrit.libreoffice.org/33787 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_canvashelper.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index b2f673bab8c5..2290c1a9fb5d 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -795,6 +795,12 @@ namespace cairocanvas
aScaledTextureMatrix.x0 = basegfx::fround( aScaledTextureMatrix.x0 );
aScaledTextureMatrix.y0 = basegfx::fround( aScaledTextureMatrix.y0 );
+
+ double x1, y1, x2, y2;
+ cairo_path_extents(pCairo, &x1, &y1, &x2, &y2);
+ aScaledTextureMatrix.x0 -= (x1 * aScaledTextureMatrix.xx);
+ aScaledTextureMatrix.y0 -= (y1 * aScaledTextureMatrix.yy);
+
cairo_pattern_set_matrix( pPattern, &aScaledTextureMatrix );
cairo_set_source( pCairo, pPattern );