sdext/source/pdfimport/tree/drawtreevisiting.cxx   |    2 ++
 sdext/source/pdfimport/tree/pdfiprocessor.cxx      |    7 ++++++-
 sdext/source/pdfimport/tree/writertreevisiting.cxx |    3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 81fbaf4bb9ddc385d4452257d731e4097dfed079
Author:     Dr. David Alan Gilbert <d...@treblig.org>
AuthorDate: Thu Feb 15 00:18:01 2024 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Feb 29 08:28:31 2024 +0100

    tdf#113050 sdext.pdfimport: Set and write TileWidth/Height
    
    Set the tile width/height from the step size and write it into the
    draw:fill-image-width/height properties.
    
    Change-Id: I70d69a6d5e77929bd14282731dd68d3bcafa9c1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163574
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx 
b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 2c02adde8874..7897dbae9d08 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -826,6 +826,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const 
std::list< std::uniqu
         aGCProps[ "draw:fill-image-name" ] =
             m_rStyleContainer.getStyleName(
             m_rStyleContainer.getStyleId(style));
+        aGCProps[ "draw:fill-image-width" ] = 
unitMMString(convPx2mm(elem.TileWidth));
+        aGCProps[ "draw:fill-image-height" ] = 
unitMMString(convPx2mm(elem.TileHeight));
 
     }
 
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx 
b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 6f4b45f21a40..2483144250b8 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -428,12 +428,17 @@ void PDFIProcessor::tilingPatternFill(int nX0, int nY0, 
int nX1, int nY1,
     }
     // TODO: That clipping might shift the fill pattern offsets
 
+    double transformedxStep = nxStep * rMat.m00 + nyStep * rMat.m01;
+    double transformedyStep = nxStep * rMat.m10 + nyStep * rMat.m11;
+
     auto pPolyElement = ElementFactory::createPolyPolyElement(
         m_pCurElement,
         getGCId(getCurrentContext()),
         aB2DPoly,
         PATH_EOFILL, // Hmm how do I know if this should be EO or not?
-        nTile, 0, 0 );
+        nTile,
+        transformedxStep * aScale.getX(),
+        transformedyStep * -aScale.getY());
     pPolyElement->updateGeometry();
     pPolyElement->ZOrder = m_nNextZOrder++;
 }
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx 
b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 746fc9e77eb2..9012aaa21038 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -1004,7 +1004,8 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, 
const std::list< std::uni
         aGCProps[ "draw:fill-image-name" ] =
             m_rStyleContainer.getStyleName(
             m_rStyleContainer.getStyleId(style));
-
+        aGCProps[ "draw:fill-image-width" ] = 
unitMMString(convPx2mm(elem.TileWidth));
+        aGCProps[ "draw:fill-image-height" ] = 
unitMMString(convPx2mm(elem.TileHeight));
     }
 
     // TODO(F1): check whether stuff could be emulated by gradient/bitmap/hatch

Reply via email to