weisJ / jsvg

Java SVG renderer
MIT License
139 stars 9 forks source link

Filters should not paint outside the filter(primitive)region #70

Open weisJ opened 8 months ago

weisJ commented 8 months ago
<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"
    viewBox="0 0 100 100">
    <defs>
        <filter id="a" width="100%" height="100%" x="0%" y="0%"
            filterUnits="objectBoundingBox">
            <feOffset dx="25" dy="25" />
            <feGaussianBlur stdDeviation="5" />
        </filter>
    </defs>
    <rect fill="orange" x="25" y="25" width="50" height="50" />
    <rect fill="red" x="25" y="25" width="50" height="50"
        filter="url(#a)" />
</svg>

Should result in a round blurred red dot in the lower right of the orange square. Currently the red part is only round on the top left as the translated red square is still painted outside the filter primitive region.