aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/pdf/PDFRenderer.java
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-09-21 20:56:24 +0000
committerGlen Mazza <gmazza@apache.org>2003-09-21 20:56:24 +0000
commitce37837aaea712ad41ba4caba73e9e8c181e3e97 (patch)
tree9c9c3923b13ce853557ad56d6f553032373710ce /src/java/org/apache/fop/render/pdf/PDFRenderer.java
parente7bb77d5f945fa50f9600cce9e567de4dc2bf0c1 (diff)
downloadxmlgraphics-fop-ce37837aaea712ad41ba4caba73e9e8c181e3e97.tar.gz
xmlgraphics-fop-ce37837aaea712ad41ba4caba73e9e8c181e3e97.zip
1.) Moved AWT Viewer classes from org.fop.viewer to org.fop.render.awt.viewer
2.) Updated AWT and PDF renderers to draw region borders more accurately. 3.) Rounding errors for determining region sizes in AWT Renderer fixed. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/pdf/PDFRenderer.java')
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFRenderer.java43
1 files changed, 18 insertions, 25 deletions
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index bb3654028..ccbe28ba0 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -590,15 +590,13 @@ public class PDFRenderer extends PrintRenderer {
}
float bwidth = bps.width / 1000f;
- updateColor(bps.color, false, null);
- currentStream.add(bwidth + " w\n");
-
- drawLine(startx, starty + bwidth / 2, endx, starty + bwidth / 2);
+ updateColor(bps.color, true, null);
+ currentStream.add(startx + " " + starty + " "
+ + width + " " + bwidth + " re\n");
+ currentStream.add("f\n");
}
- bps = (BorderProps)block.getTrait(Trait.BORDER_START);
+ bps = (BorderProps)block.getTrait(Trait.BORDER_AFTER);
if (bps != null) {
- float endy = starty + height;
-
if (!started) {
started = true;
closeText();
@@ -607,16 +605,13 @@ public class PDFRenderer extends PrintRenderer {
}
float bwidth = bps.width / 1000f;
- updateColor(bps.color, false, null);
- currentStream.add(bwidth + " w\n");
-
- drawLine(startx + bwidth / 2, starty, startx + bwidth / 2, endy);
+ updateColor(bps.color, true, null);
+ currentStream.add(startx + " " + (starty + height - bwidth) + " "
+ + width + " " + bwidth + " re\n");
+ currentStream.add("f\n");
}
- bps = (BorderProps)block.getTrait(Trait.BORDER_AFTER);
+ bps = (BorderProps)block.getTrait(Trait.BORDER_START);
if (bps != null) {
- float sy = starty + height;
- float endx = startx + width;
-
if (!started) {
started = true;
closeText();
@@ -625,16 +620,13 @@ public class PDFRenderer extends PrintRenderer {
}
float bwidth = bps.width / 1000f;
- updateColor(bps.color, false, null);
- currentStream.add(bwidth + " w\n");
-
- drawLine(startx, sy - bwidth / 2, endx, sy - bwidth / 2);
+ updateColor(bps.color, true, null);
+ currentStream.add(startx + " " + starty + " "
+ + bwidth + " " + height + " re\n");
+ currentStream.add("f\n");
}
bps = (BorderProps)block.getTrait(Trait.BORDER_END);
if (bps != null) {
- float sx = startx + width;
- float endy = starty + height;
-
if (!started) {
started = true;
closeText();
@@ -643,9 +635,10 @@ public class PDFRenderer extends PrintRenderer {
}
float bwidth = bps.width / 1000f;
- updateColor(bps.color, false, null);
- currentStream.add(bwidth + " w\n");
- drawLine(sx - bwidth / 2, starty, sx - bwidth / 2, endy);
+ updateColor(bps.color, true, null);
+ currentStream.add((startx + width - bwidth) + " " + starty + " "
+ + bwidth + " " + height + " re\n");
+ currentStream.add("f\n");
}
if (started) {
//restoreGraphicsState();