[ https://issues.apache.org/jira/browse/BATIK-925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Khaled Hosny updated BATIK-925: ------------------------------- Attachment: empty-path.diff The wong x and y values in the bounding box here is because since revision 426986 SVGPathElementBridge.buildShape() adds a shape node for the path unconditionally, which results in adding a path whose x, y, width and height are 0 which in turn results in wrong bounds calculation. The attached patch fixes this case as well as the case of path data that results in empty shape (e.g. consists solely of move commands). > <path> elements with empty path data (i.e. d="") are *not* ignored for bounds > calculations > ------------------------------------------------------------------------------------------ > > Key: BATIK-925 > URL: https://issues.apache.org/jira/browse/BATIK-925 > Project: Batik > Issue Type: Bug > Components: Bridge > Affects Versions: 1.8 > Environment: Operating System: Linux > Platform: PC > Reporter: Thomas Behr > Assignee: Batik Developer's Mailing list > Attachments: SvgEmptyPathTest.java, empty-path.diff > > > Up to and including BATIK v 1.6, > org.apache.batik.bridge.SVGPathElementBridge.buildShape ignored path elements > with empty d attributes (see revision 385978 in the SVG trunk branch for > SVGPathElementBridge.java). > Since BATIK v 1.7 this is no longer the case (see revision 426986 and later) > which results in bad bounds for org.apache.batik.gvt.GraphicsNode instances > corresponding to SVG documents that use <path d="" .../> but would not > normally > include the origin of the coordinate system in their bounds. > To illustrate this issue, see the attached test case > Run against BATIK 1.6, this prints > rectWithoutEmptyPath.bounds = [x=100.0;y=100.0;w=100.0;h=100.0] > rectWithEmptyPath.bounds = [x=100.0;y=100.0;w=100.0;h=100.0] > but > rectWithoutEmptyPath.bounds = [x=100.0;y=100.0;w=100.0;h=100.0] > rectWithEmptyPath.bounds = [x=0.0;y=0.0;w=200.0;h=200.0] > when run against BATIK 1.7 or later. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: batik-dev-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-dev-h...@xmlgraphics.apache.org