summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2024-02-15 00:18:01 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-29 08:28:31 +0100
commit81fbaf4bb9ddc385d4452257d731e4097dfed079 (patch)
tree0e6abc689cd6486de34b266dcc891bb7456b8703 /sdext/source
parent784696e47c7f28dac111b95e61f06a9a1f7cdc97 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source')
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx2
-rw-r--r--sdext/source/pdfimport/tree/pdfiprocessor.cxx7
-rw-r--r--sdext/source/pdfimport/tree/writertreevisiting.cxx3
3 files changed, 10 insertions, 2 deletions
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