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

add support for stroke-width:0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      SVG 1.0 specification : "A zero value causes no stroke to be painted."

      Right now, a stroke is still painted.

      http://www.w3.org/TR/SVG/painting.html#StrokeWidthProperty

      Here is the modifications I suggest for org.apache.batik.bridge.PaintServer :

      /**

      • Converts for the specified element, its stroke paint properties
      • to a Paint object.
        *
      • @param strokedElement the element interested in a Paint
      • @param strokedNode the graphics node to stroke
      • @param ctx the bridge context
        */
        public static Paint convertStrokePaint(Element strokedElement,
        GraphicsNode strokedNode,
        BridgeContext ctx) {
        Value v;
        > v = CSSUtilities.getComputedStyle
        > (strokedElement, SVGCSSEngine.STROKE_WIDTH_INDEX);
        > float width = v.getFloatValue();
        >
        > if( width == 0.0f ) { > //stop here no stroke should be painted > return null; > }

      v = CSSUtilities.getComputedStyle
      (strokedElement, SVGCSSEngine.STROKE_OPACITY_INDEX);
      float opacity = convertOpacity(v);
      v = CSSUtilities.getComputedStyle
      (strokedElement, SVGCSSEngine.STROKE_INDEX);

      return convertPaint(strokedElement,
      strokedNode,
      v,
      opacity,
      ctx);
      }

        Attachments

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              nicolas.socheleau@bitflash.com Nicolas Socheleau
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: