Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<mask> area doesn't get expanded beyond object's bounding box #65

Closed
stanio opened this issue Mar 2, 2024 · 4 comments
Closed

<mask> area doesn't get expanded beyond object's bounding box #65

stanio opened this issue Mar 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@stanio
Copy link

stanio commented Mar 2, 2024

It appears <mask> area doesn't get expanded beyond the bounding box of the object it is applied to:

It could "shrink" inside the object's bounding box, though. The most apparent effect is that a stroke that goes beyond the object's bounding box gets clipped from view.

mask-0.svg

    <mask id="aperture" maskUnits="userSpaceOnUse"
        x="0" y="0" width="500" height="500">
Actual Expected
jsvg-mask-0 chrome-mask-0

mask-1.svg

    <mask id="aperture" maskUnits="userSpaceOnUse"
        x="50" y="50" width="450" height="450">
Actual Expected
jsvg-mask-1 chrome-mask-1

mask-2.svg

    <mask id="aperture" maskUnits="userSpaceOnUse"
        x="60" y="60" width="440" height="440">
Actual Expected
jsvg-mask-2 chrome-mask-2

Initially found in #64 (comment)

@weisJ weisJ added the bug Something isn't working label Mar 2, 2024
@weisJ
Copy link
Owner

weisJ commented Mar 3, 2024

This should be fixed in the latest snapshot

@stanio
Copy link
Author

stanio commented Mar 4, 2024

Trying out current 1.5.0-SNAPSHOT (gradlew --refresh-dependencies1.5.0-20240304.002615-19) – the outer stroke is now fully visible but a different defect appears. Looks like the overall mask is scaled (enlarged):

mask-0 mask-1 mask-2
mask-0 mask-1 mask-2

Notice the circular hole is bigger than the debug overlay that uses the same path as for the mask. A thick semi-transparent ring is also visible.

@weisJ
Copy link
Owner

weisJ commented Mar 5, 2024

This is related to #66. I have a fix locally, will push once #67 is resolved. I noticed that the library I am using to compare images in tests doesn’t handle transparent pixels and thus multiple tests have failed silently for the past few versions. I need to catch up with those before work on subpixel alignment can be continued.

weisJ added a commit that referenced this issue Mar 8, 2024
This isn't fully correct either but works for most SVGs out there.
Relates to #65
@stanio
Copy link
Author

stanio commented Mar 10, 2024

Just tried with a current 1.5.0-SNAPSHOT – it now (currently) appears just right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants