aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/pdf
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-07-14 21:25:39 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-07-14 21:25:39 +0000
commitfbf34c38dcf255f1235c1f970d49d714a81c2b97 (patch)
tree4b0e033c37e26c0b909a2dcc2995c66fb5feab71 /src/java/org/apache/fop/pdf
parent5166be88be7e259cff51b0f5d38abc67c51309d3 (diff)
downloadxmlgraphics-fop-fbf34c38dcf255f1235c1f970d49d714a81c2b97.tar.gz
xmlgraphics-fop-fbf34c38dcf255f1235c1f970d49d714a81c2b97.zip
Use the appropriate double formatter depending on the selected output
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1610539 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf')
-rw-r--r--src/java/org/apache/fop/pdf/PDFFunction.java10
-rw-r--r--src/java/org/apache/fop/pdf/PDFShading.java10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java
index ed2d1d16c..f84c52609 100644
--- a/src/java/org/apache/fop/pdf/PDFFunction.java
+++ b/src/java/org/apache/fop/pdf/PDFFunction.java
@@ -26,6 +26,8 @@ import java.util.List;
import org.apache.fop.render.gradient.Function;
import org.apache.fop.render.gradient.Function.SubFunctionRenderer;
+import org.apache.fop.render.gradient.GradientMaker;
+import org.apache.fop.render.gradient.GradientMaker.DoubleFormatter;
/**
* class representing a PDF Function.
@@ -119,7 +121,13 @@ public class PDFFunction extends PDFObject {
}
};
StringBuilder out = new StringBuilder();
- function.output(out, subFunctionRenderer);
+ GradientMaker.DoubleFormatter doubleFormatter = new DoubleFormatter() {
+
+ public String formatDouble(double d) {
+ return PDFNumber.doubleOut(d);
+ }
+ };
+ function.output(out, doubleFormatter, subFunctionRenderer);
return encode(out.toString());
}
diff --git a/src/java/org/apache/fop/pdf/PDFShading.java b/src/java/org/apache/fop/pdf/PDFShading.java
index 577e10a09..fa12771b9 100644
--- a/src/java/org/apache/fop/pdf/PDFShading.java
+++ b/src/java/org/apache/fop/pdf/PDFShading.java
@@ -21,6 +21,8 @@ package org.apache.fop.pdf;
import java.util.List;
+import org.apache.fop.render.gradient.GradientMaker;
+import org.apache.fop.render.gradient.GradientMaker.DoubleFormatter;
import org.apache.fop.render.gradient.Shading;
@@ -102,7 +104,13 @@ public class PDFShading extends PDFObject {
}
};
StringBuilder out = new StringBuilder();
- shading.output(out, functionRenderer);
+ GradientMaker.DoubleFormatter doubleFormatter = new DoubleFormatter() {
+
+ public String formatDouble(double d) {
+ return PDFNumber.doubleOut(d);
+ }
+ };
+ shading.output(out, doubleFormatter, functionRenderer);
return out.toString();
}