diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-08-29 17:45:04 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-08-29 17:45:04 +0000 |
commit | a153841f94703d85d500e008614af8e4db3a1fc2 (patch) | |
tree | 69ab5c0039c3b74bb6deb1423b1cadbef0a85cbb /src/java/org/apache/fop/render/afp/AFPSVGHandler.java | |
parent | 76297865418149d49ca4a04526d2cbcbdd808b0a (diff) | |
download | xmlgraphics-fop-a153841f94703d85d500e008614af8e4db3a1fc2.tar.gz xmlgraphics-fop-a153841f94703d85d500e008614af8e4db3a1fc2.zip |
ObjectContainer/IncludeObject structure fixes.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@690345 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/afp/AFPSVGHandler.java')
-rw-r--r-- | src/java/org/apache/fop/render/afp/AFPSVGHandler.java | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java index 8ea7467e5..5d9fcdb7d 100644 --- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java @@ -37,6 +37,7 @@ import org.apache.fop.render.AbstractGenericSVGHandler; import org.apache.fop.render.Renderer; import org.apache.fop.render.RendererContext; import org.apache.fop.render.RendererContextConstants; +import org.apache.fop.render.RendererContext.RendererContextWrapper; import org.apache.fop.svg.SVGEventProducer; import org.apache.fop.svg.SVGUserAgent; import org.apache.xmlgraphics.util.QName; @@ -90,6 +91,9 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler { return afpi; } + private static final int X = 0; + private static final int Y = 1; + /** * Render the SVG document. * @@ -124,32 +128,13 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler { AFPUnitConverter unitConv = state.getUnitConverter(); -// RendererContextWrapper rctx = RendererContext.wrapRendererContext(context); -// int currx = rctx.getCurrentXPosition(); -// int curry = rctx.getCurrentYPosition(); -// int afpx = Math.round(unitConv.mpt2units(currx)); -// int afpy = Math.round(unitConv.mpt2units(curry)); -// objectAreaInfo.setOffsetX(afpx); -// objectAreaInfo.setOffsetY(afpy); - - AffineTransform at = state.getData().getTransform(); - float transX = (float)at.getTranslateX(); - float transY = (float)at.getTranslateY(); -// int afpx = Math.round(unitConv.mpt2units(currx)); -// objectAreaInfo.setX(afpx); -// int afpy = Math.round(unitConv.mpt2units(curry)); -// objectAreaInfo.setY(afpy); -// objectAreaInfo.setX(coords[0]); -// objectAreaInfo.setY(coords[1]); - objectAreaInfo.setX(Math.round(transX)); - objectAreaInfo.setY(Math.round(transY)); - -// AffineTransform at = currentState.getData().getTransform(); -// int x = (int)Math.round(at.getTranslateX()); -// objectAreaInfo.setX(x); -// -// int y = (int)Math.round(at.getTranslateY()); -// objectAreaInfo.setY(y); + RendererContextWrapper rctx = RendererContext.wrapRendererContext(context); + int currx = rctx.getCurrentXPosition(); + int curry = rctx.getCurrentYPosition(); + float[] srcPts = {currx, curry}; + int[] coords = unitConv.mpts2units(srcPts); + objectAreaInfo.setX(coords[X]); + objectAreaInfo.setY(coords[Y]); int resolution = afpInfo.getResolution(); objectAreaInfo.setWidthRes(resolution); |