diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-08-15 15:31:55 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-08-15 15:31:55 +0000 |
commit | bacc153b5daf6baacb9f1b3b65d8a5ffe7ecc5d1 (patch) | |
tree | 07031919fee6b9c74a42ef5de3fc97d6fb2195d0 /src/java/org/apache/fop/render/intermediate/IFParser.java | |
parent | 6418e71d293be2a7f458ecef5bb85561e4ba2ad0 (diff) | |
download | xmlgraphics-fop-bacc153b5daf6baacb9f1b3b65d8a5ffe7ecc5d1.tar.gz xmlgraphics-fop-bacc153b5daf6baacb9f1b3b65d8a5ffe7ecc5d1.zip |
Had to introduce "clip-rect" to handle clipping on background images, leader etc. A full viewport is probably too heavy-weight here. This is to be considered temporary pending verification with SVG and PCL implementations.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@686253 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/intermediate/IFParser.java')
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/IFParser.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFParser.java b/src/java/org/apache/fop/render/intermediate/IFParser.java index e365bb519..50c061ff4 100644 --- a/src/java/org/apache/fop/render/intermediate/IFParser.java +++ b/src/java/org/apache/fop/render/intermediate/IFParser.java @@ -136,6 +136,7 @@ public class IFParser implements IFConstants { elementHandlers.put(EL_GROUP, new GroupHandler()); elementHandlers.put(EL_FONT, new FontHandler()); elementHandlers.put(EL_TEXT, new TextHandler()); + elementHandlers.put(EL_CLIP_RECT, new ClipRectHandler()); elementHandlers.put(EL_RECT, new RectHandler()); elementHandlers.put(EL_BORDER_RECT, new BorderRectHandler()); elementHandlers.put(EL_IMAGE, new ImageHandler()); @@ -441,6 +442,18 @@ public class IFParser implements IFConstants { } + private class ClipRectHandler extends AbstractElementHandler { + + public void startElement(Attributes attributes) throws IFException { + int x = Integer.parseInt(attributes.getValue("x")); + int y = Integer.parseInt(attributes.getValue("y")); + int width = Integer.parseInt(attributes.getValue("width")); + int height = Integer.parseInt(attributes.getValue("height")); + painter.clipRect(new Rectangle(x, y, width, height)); + } + + } + private class RectHandler extends AbstractElementHandler { public void startElement(Attributes attributes) throws IFException { |