Skip to content

If masked object is off-screen before transform is applied, not visible outside Inkscape

Summary:

While Inkscape displays the path in the document below, which has inverse mask applied to it, correctly, other SVG renderers (GIMP, Firefox etc.) don't show anything at all.

Steps to reproduce:

  • Open bug.svg with Inkscape.
  • The masked path should display correctly.
  • Open the same document with GIMP or Firefox.
  • Nothing should show up.

What happened?

The masked path is not shown at all in renderers apart from Inkscape.

Issue seems to happen whenever an object was off-canvas when it was masked, then was moved back on-canvas.

What should have happened?

The masked path should show up in all supported SVG renderers.

That is,

  1. there should be x, y, width, height values set for mask, which at least fill the visual bounding box of the mask (or the intersection of the visual bbox of the mask, and the union of the visual bboxes of all objects that use the mask)
  2. Or we should produce masks with the maskUnits unset (defaults to objectBoundingBox), instead of setting it to maskUnits="userSpaceOnUse". (this does not work when multiple objects share the same mask).

Version info

Inkscape 1.2-dev (1e4f7a3e85, 2022-01-31)
Edited by Nathan Lee
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information