aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-07-10 08:22:24 +0000
committerKeiron Liddle <keiron@apache.org>2002-07-10 08:22:24 +0000
commit895ac332959ec0d677f48be4aab0ad11d12f1c6c (patch)
tree39ebae85e861e8378f2d31ba93d79c9410c0783c /src/org/apache
parent46b7a2ef190c109eda8220ada3b98b5b497b8c88 (diff)
downloadxmlgraphics-fop-895ac332959ec0d677f48be4aab0ad11d12f1c6c.tar.gz
xmlgraphics-fop-895ac332959ec0d677f48be4aab0ad11d12f1c6c.zip
improved patterns, the contents should be visible now
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194992 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r--src/org/apache/fop/svg/PDFGraphics2D.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/org/apache/fop/svg/PDFGraphics2D.java b/src/org/apache/fop/svg/PDFGraphics2D.java
index 98736e5ab..b9f20737f 100644
--- a/src/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/org/apache/fop/svg/PDFGraphics2D.java
@@ -768,7 +768,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
// this makes the pattern the right way up, since
// it is outside the original transform around the
// whole svg document
- pattStream.write("1 0 0 -1 0 " + rect.getHeight() + " cm\n");
+ pattStream.write("1 0 0 -1 0 " + (rect.getHeight() + rect.getY()) + " cm\n");
pattStream.write(pattGraphic.getString());
pattStream.write("Q");
@@ -776,16 +776,20 @@ public class PDFGraphics2D extends AbstractGraphics2D {
ArrayList bbox = new ArrayList();
bbox.add(new Double(0));
bbox.add(new Double(0));
- bbox.add(new Double(rect.getWidth()));
- bbox.add(new Double(rect.getHeight()));
+ bbox.add(new Double(rect.getWidth() + rect.getX()));
+ bbox.add(new Double(rect.getHeight() + rect.getY()));
+
ArrayList translate = new ArrayList();
- // TODO combine with pattern transform
- translate.add(new Double(1));
- translate.add(new Double(0));
- translate.add(new Double(0));
- translate.add(new Double(1));
- translate.add(new Double(0/*rect.getX()*/));
- translate.add(new Double(0/*rect.getY()*/));
+ AffineTransform pattt = pp.getPatternTransform();
+ pattt.translate(rect.getWidth() + rect.getX(), rect.getHeight() + rect.getY());
+ double[] flatmatrix = new double[6];
+ pattt.getMatrix(flatmatrix);
+ translate.add(new Double(flatmatrix[0]));
+ translate.add(new Double(flatmatrix[1]));
+ translate.add(new Double(flatmatrix[2]));
+ translate.add(new Double(flatmatrix[3]));
+ translate.add(new Double(flatmatrix[4]));
+ translate.add(new Double(flatmatrix[5]));
FontSetup.addToResources(pdfDoc, res, fi);