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

<mask> using <filter> not rendered correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: GVT
    • Labels:
      None
    • Environment:
      Ubuntu 14.04, java 1.8.0_60

      Description

      This svg below is supposed to create a white polygon on grey background, and is rendered correctly in Firefox. But trying to display in Java using JSVGCanvas shows white stripes in the background. As a workaround, opacity in <use> seems to work. (Original files come from wikipedia's constellations, e.g. en.wikipedia.org/wiki/Leo_(constellation) )

      <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="485.028pt" height="456.053pt" viewBox="0 0 485.028 456.053" version="1.1">
      <defs>
      <filter id="alpha" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
      <feColorMatrix type="matrix" in="SourceGraphic" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
      </filter>
      <mask id="mask0">
      <g filter="url(#alpha)">
      <rect x="0" y="0" width="486" height="457" style="fill:rgb(100%,100%,100%);fill-opacity:0.149994;stroke:none;"/>
      </g>
      </mask>

      <g id="surface2">
      <path style=" stroke:none;fill-rule:nonzero;fill:rgb(13.730068%,12.159915%,12.54902%);fill-opacity:1;" d="M 376.316406 213.578125 L 309.726562 248.511719 L 310.457031 254.695312 L 296.265625 256.878906 L 282.4375 258.335938 L 285.347656 287.808594 L 278.070312 289.265625 L 282.4375 339.847656 L 272.976562 340.9375 L 274.070312 350.035156 L 253.328125 114.960938 L 277.707031 112.050781 L 303.90625 108.050781 L 317.003906 66.203125 L 336.652344 61.105469 L 353.027344 55.648438 L 399.605469 206.664062 L 376.316406 213.578125 Z M 0.800781 384.96875 L 420.34375 384.96875 L 420.34375 0.335938 L 0.800781 0.335938 L 0.800781 384.96875 Z M 0.800781 384.96875 "/>
      </g>
      </defs>
      <g id="surface0">
      <use xlink:href="#surface2" transform="matrix(1,0,0,1,33,18)" mask="url(#mask0)"/>
      <!-use xlink:href="#surface2" transform="matrix(1,0,0,1,33,18)" opacity="0.15"/->
      </g>
      </svg>
      --------------------------------------
      JFrame f = new JFrame("Batik");
      final JPanel panel = new JPanel(new BorderLayout());
      JSVGCanvas svgCanvas = new JSVGCanvas();
      panel.add("Center", svgCanvas);
      File file = new File( "aaa.svg" );
      svgCanvas.setURI(file.toURI().toURL().toString());
      f.getContentPane().add( panel );
      f.setSize(600, 600);
      f.setVisible(true);

        Attachments

        1. leo.png
          5 kB
          Jan Tošovský
        2. leo.svg
          1 kB
          Jan Tošovský

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              laune Wolfgang Laun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: