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

allow "opacity" attribute on group of paths

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: SVG DOM
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      I have a bit of code that uses batik at a low level, and sending SVG with the following elements seems to result in the GraphicsNode not painting anything.
      <g opacity="0.1">
      <path d="M101.5,325.5c0-37.396,19.75-70.263,49.364-88.731h-5.481C117.096,256.154,98.5,288.693,98.5,325.5
      c0,36.062,17.85,68.032,45.178,87.543h5.324C120.425,394.373,101.5,362.107,101.5,325.5z"/>
      <path d="M310.5,325.5c0,36.607-18.925,68.873-47.501,87.543h5.324c27.327-19.511,45.177-51.48,45.177-87.543
      c0-36.807-18.596-69.346-46.883-88.731h-5.481C290.75,255.237,310.5,288.104,310.5,325.5z"/>
      </g>

      changing "opacity" to "fill-opacity" results in the desired behavior when painting. But according to the SVG spec, opacity should be allowed on groups?

      Here's now the GraphicsNode is created.

      // Parse the SVG document.
      SVGDocument doc = new SAXSVGDocumentFactory(XMLResourceDescriptor.getXMLParserClassName()).createSVGDocument(null, data.inputStream());
      UserAgent userAgent = new UserAgentAdapter();
      BridgeContext ctx = new BridgeContext(userAgent, new DocumentLoader(userAgent));
      ctx.setDynamicState(BridgeContext.STATIC);
      GraphicsNode node = new GVTBuilder().build(ctx, doc);

      Sorry this isn't more detailed - let me know if this isn't enough information.

        Attachments

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              couk@google.com couk
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: