Mask must contain single element

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
alandran
Posts: 5
Joined: Tue Mar 13, 2018 6:55 am

Mask must contain single element

Postby alandran » Fri Apr 13, 2018 5:53 am

According to my reading of specification, mask can contain any graphical elements or container elements. But it seems that inkscape only masks using first element.
If you wrap mask content in group in example bellow, Inkscape renders it correctly as expected.

My question: is this expected behavior e.g. for historical reasons or should I file bugreport?

Images (not to scale)
Inkscape
Image
Chrome/Gimp
Image


Tested on 0.92.2 5c3e80d, and fairly recent master

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<svg baseProfile="full" height="10cm" version="1.1" width="10cm" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink">
   <defs>
      <mask id="id1">
         <rect fill="white" height="100" width="100" x="0" y="0" />
         <circle cx="50" cy="50" fill="black" r="5" />
      </mask>
   </defs>
   <circle cx="50" cy="50" fill="red" mask="url(#id1)" r="10" />
</svg>

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Mask must contain single element

Postby Moini » Fri Apr 13, 2018 6:57 am

After some testing, it seems your theory isn't entirely correct, see screenshot. It seems to work with more than one object only where they do not intersect. When they intersect, their order in the mask doesn't appear to make a difference, which is strange. I don't understand how Inkscape decides which one to pick.

Bildschirmfoto_2018-04-12_22-27-34.png
Bildschirmfoto_2018-04-12_22-27-34.png (84.75 KiB) Viewed 2605 times


So, yes, there is a problem, but it still needs some more testing.

Can you play around with it and then make a bug report? (or better, check first if there is one already: https://bugs.launchpad.net/inkscape )
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

alandran
Posts: 5
Joined: Tue Mar 13, 2018 6:55 am

Re: Mask must contain single element

Postby alandran » Fri Apr 13, 2018 6:44 pm

Oh, I tried forums but not launchpad. This problem is known from 0.48 back in 2011 https://bugs.launchpad.net/inkscape/+bug/794472

Grouping mask content is fairly easy workaround. Thanks for input about non-overlaping objects. Given lack of action on given bug I dont think I will investigate/document it further.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Mask must contain single element

Postby Moini » Fri Apr 13, 2018 11:00 pm

I've subscribed to the report. Some time 'soon', that bug tracker is going to be closed, and reports that nobody cares about will probably not be migrated to a new tracker. This will make sure I get a reminder to migrate it, if needed.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Discuss Software Issues”