Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-925

<path> elements with empty path data (i.e. d="") are *not* ignored for bounds calculations

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC

      Description

      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.

        Attachments

        1. SvgEmptyPathTest.java
          4 kB
          Thomas Behr
        2. empty-path.diff
          0.7 kB
          Khaled Hosny

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              thomas.behr@yworks.com Thomas Behr
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: