Stacked clip paths do not work when grouped with other objects

Bug #1067271 reported by Rena Kunisaki
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Ted Janeczko

Bug Description

If an object has a clip mask, and that object is part of a group containing other, non-clipped objects, and that group is itself used as a clip mask, the non-clipped objects are omitted from the mask - they appear in the XML, but the affected area does not appear.

Attached file demonstrates the problem. The red square has a clip mask and is grouped with the yellow which does not. When this group is set as a clip mask for the blue square, the yellow square is ignored - the corresponding area of the blue square does not appear.

Version 0.48-devel-r, 2012 Oct 16, Linux x86

Revision history for this message
Rena Kunisaki (i-am-inuyasha) wrote :
Revision history for this message
su_v (suv-lp) wrote :

On Mac OS X 10.5.8 and OS X 10.7.4:
- not reproduced with Inkscape 0.48.3.1
- not reproduced with Inkscape 0.48+devel r10330, r10433, r10444, r10450
- reproduced with Inkscape 0.48+devel r10454, r10577, r11804

Regression possibly introduced with
r10451 "Merge SPCanvasArena caching layer work"
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/10451>

Note:
None of current web browsers (Chromium, Firefox, Opera, Safari) seem to support rendering such nested clips. Besides stable Inkscape versions (0.47, 0.48), only Squiggle (Batik 1.7, 18pre) and librsvg 2.36 render it as shown in the "Expected result" bitmap image.

tags: added: clipping regression
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.49
status: New → Confirmed
tags: added: svg
ScislaC (scislac)
tags: added: blocker
Revision history for this message
Martin Owens (doctormo) wrote :

After experimenting, I notice these things:

 1) that the inital bounding box after the mask is the size of the original large blue square. It should be the resulting two bits of the blue square instead.
 2) de-selecting and reselecting and moving the new object changes this bounding box to the size of the two bits of blue square.
 3) The second blue bit does not appear to render, even though it's accounted for in the bounding box.

Thus I conclude that the error is most likely in rendering, than it is in other parts.

Changed in inkscape:
assignee: nobody → Martin Owens (doctormo)
Revision history for this message
Rena Kunisaki (i-am-inuyasha) wrote :

I think there are two different bugs there - that the object doesn't show up when it's within the bounding box (this bug) and that the bounding box doesn't show correctly until deselecting the object.

Revision history for this message
su_v (suv-lp) wrote :

> that the bounding box doesn't show correctly until deselecting the object.

Known regression in current trunk, tracked in bug #1005085. AFAICT bug #1005085 is unrelated to the rendering issue reported here (I do recall noticeable flickering of the visible parts e.g. when rotating the clipped objects in a recreated test file as if an invisible rectangle area was actually blanking out visible parts of the clipped objects).

Revision history for this message
Ted Janeczko (janeczko-ted) wrote :

This bug was driving me nuts, so I looked into fixing it. Basically there's an issue with the order in which the clip path is painted and composited in the clip method of the DrawingItem class. The attached patch should work, although I'm not entirely sure that it's the most efficient method.

Revision history for this message
Alvin Penner (apenner) wrote :

thanks Ted, nice work!

tested and committed to rev 11943

Changed in inkscape:
status: Confirmed → Fix Committed
assignee: Martin Owens (doctormo) → nobody
Kris (kris-degussem)
tags: removed: blocker
Revision history for this message
Martin Owens (doctormo) wrote :

Thanks Ted, I was struggling to compile trunk over here and then you fixed the issue. Awesome! couldn't test the patch for same compile reasons. not sure why.

Revision history for this message
Ted Janeczko (janeczko-ted) wrote :

My pleasure! Hope you're able to get the trunk to compile soon, Martin!

su_v (suv-lp)
Changed in inkscape:
assignee: nobody → Ted Janeczko (janeczko-ted)
Revision history for this message
su_v (suv-lp) wrote :

Follow-up report:
Bug #1110397 “trunk: opacity of clipped group is ignored (regression)”
<https://bugs.launchpad.net/inkscape/+bug/1110397>

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.