summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-06-21 12:28:30 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-07-01 16:12:06 +0200
commit12430a56f636f88be775b0fa8979cbb915a4cd23 (patch)
treee1acdbc3f2bdf377ef47cf5a8fd30b0c8a1c9c97 /drawinglayer
parente6801d4e910b1da2635472f3b6d0b777af116554 (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/+/169444 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 4882847bcc2c..394b18ca7162 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1091,6 +1091,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;
@@ -1117,6 +1121,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);
}