summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-06-21 12:28:30 +0200
committerAndras Timar <andras.timar@collabora.com>2024-06-29 19:00:55 +0200
commite6098e7383db20e35b11a5b85c9ab52938c15c25 (patch)
tree6bd1031c9ef0d70f34b832ef618f4dc26a9ffad9 /drawinglayer
parent293c7bd927999e4cebbc96e94e860714bcceef41 (diff)
tdf#161086 bitmap location wrong with SVG with an embedded PNG
we need to transform the location of the wallpaper rect to match where we want the wallpaper to start tiling from. regression from commit 3cbe3a0259bea4dec70e72191ec3c03441926a07 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Mon Jun 14 15:05:59 2021 +0200 tdf#101083 speed up SVG rendering with pattern fill Change-Id: I624edd63135875fdc9526015f0f5642d5c694934 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169485 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 10f0e0570be7..734ad392b161 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1092,6 +1092,10 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
Wallpaper aWallpaper(aTileImage);
aWallpaper.SetColor(COL_TRANSPARENT);
+ Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(),
+ aMaskRect.getY() % aTileImage.GetSizePixel().Height());
+ tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel());
+ aWallpaper.SetRect(aPaperRect);
mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper);
mpOutputDevice->Pop();
return;
@@ -1118,6 +1122,10 @@ void VclPixelProcessor2D::processPatternFillPrimitive2D(
{
Wallpaper aWallpaper(aTileImage);
aWallpaper.SetColor(COL_TRANSPARENT);
+ Point aPaperPt(aMaskRect.getX() % aTileImage.GetSizePixel().Width(),
+ aMaskRect.getY() % aTileImage.GetSizePixel().Height());
+ tools::Rectangle aPaperRect(aPaperPt, aTileImage.GetSizePixel());
+ aWallpaper.SetRect(aPaperRect);
mpOutputDevice->DrawWallpaper(aMaskRect, aWallpaper);
}