aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/java2d
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-08-03 14:25:41 +0000
committerJeremias Maerki <jeremias@apache.org>2009-08-03 14:25:41 +0000
commit837d5f3d513c10baf7d96ddb3d4f3edc18c9dec8 (patch)
tree8d4224ff972e68d44c2782734b6d06f3a1554320 /src/java/org/apache/fop/render/java2d
parent13646157016822e501223b699d2370b86ffab1f2 (diff)
downloadxmlgraphics-fop-837d5f3d513c10baf7d96ddb3d4f3edc18c9dec8.tar.gz
xmlgraphics-fop-837d5f3d513c10baf7d96ddb3d4f3edc18c9dec8.zip
Bugzilla #47311:
Fixed typos. Bugfix: when crop-offset wasn't specified, but bleed was, the media box was wrong. Tried to fix encapsulation problem mentioned by Vincent. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@800401 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/java2d')
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DRenderer.java22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
index 265315ecc..aa25b3325 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
@@ -24,6 +24,7 @@ import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
+import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.font.GlyphVector;
import java.awt.geom.AffineTransform;
@@ -75,7 +76,7 @@ import org.apache.fop.fonts.Typeface;
import org.apache.fop.render.AbstractPathOrientedRenderer;
import org.apache.fop.render.Graphics2DAdapter;
import org.apache.fop.render.RendererContext;
-import org.apache.fop.render.extensions.prepress.PageBoundariesAttributes;
+import org.apache.fop.render.extensions.prepress.PageBoundaries;
import org.apache.fop.render.extensions.prepress.PageScaleAttributes;
import org.apache.fop.render.pdf.CTMHelper;
import org.apache.fop.util.CharUtilities;
@@ -292,20 +293,10 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
this.currentPageViewport = pageViewport;
try {
- String bleed = (String) currentPageViewport.getForeignAttributes().get(
- PageBoundariesAttributes.EXT_BLEED);
- String cropOffset = (String) currentPageViewport.getForeignAttributes().get(
- PageBoundariesAttributes.EXT_CROP_OFFSET);
- String cropBoxValue = (String) currentPageViewport.getForeignAttributes().get(
- PageBoundariesAttributes.EXT_CROP_BOX);
- Rectangle2D bounds = PageBoundariesAttributes.getCropBoxRectangle(
- pageViewport.getViewArea(),
- bleed,
- cropOffset,
- cropBoxValue
- );
- Rectangle2D bleedBox = PageBoundariesAttributes.getBleedBoxRectangle(
- pageViewport.getViewArea(), bleed);
+ PageBoundaries boundaries = new PageBoundaries(
+ pageViewport.getViewArea().getSize(), pageViewport.getForeignAttributes());
+ Rectangle bounds = boundaries.getCropBox();
+ Rectangle bleedBox = boundaries.getBleedBox();
this.pageWidth = (int) Math.round(bounds.getWidth() / 1000f);
this.pageHeight = (int) Math.round(bounds.getHeight() / 1000f);
@@ -325,7 +316,6 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
scaleY *= scales.getY();
}
-
scaleX = scaleX
* (25.4f / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
/ userAgent.getTargetPixelUnitToMillimeter();