weisJ / jsvg

Java SVG renderer
MIT License
118 stars 6 forks source link

`mask` or `clip-path` clips filter effect outside object bounding box #84

Closed stanio closed 1 week ago

stanio commented 1 month ago
filter-mask.svg ```xml ```
Actual Expected
actual expected

I speculate it is a kind of optimization (related to #65 ?), as artificially extending the object bounds, including a bigger fully transparent geometry, works around the problem:

  <use href="#graphic2" filter="url(#drop-shadow)" mask="url(#graphic1-mask)" />

  <!--circle id="graphic2" cx="120" cy="110" r="70" fill="orange" /-->
  <g id="graphic2">
    <rect x="50" y="40" width="160" height="160" opacity="0" />
    <circle cx="120" cy="110" r="70" fill="orange" />
  </g>

I had initially tried changing the width and height of filters and masks to much > 100% but observed no effect.

weisJ commented 1 month ago

Should be fixed in current snapshot

stanio commented 1 month ago

Tested with current 1.5.1-SNAPSHOT – fixed. Thank you very much!

weisJ commented 1 week ago

Now available in 1.6.0