drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit d53191ebf73a70f63b4740bf8c85e023fdb8eb37
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jun 21 12:28:30 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Jun 27 16:57:57 2024 +0200

    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.gran...@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.gran...@collabora.co.uk>
    (cherry picked from commit 7b807a6b793198c00db9b2c2c3a5eb3ebfe16ad9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169485
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index e71cda4a0bb6..362b3a55cabe 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1084,6 +1084,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;
@@ -1110,6 +1114,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);
     }
 

Reply via email to