From 775dd4552f125326bfbb8873433972f6c37adc9e Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sun, 9 Dec 2012 11:53:12 -0500 Subject: stacked clip paths. patch by Ted Janeczko for Bug 1067271 Fixed bugs: - https://launchpad.net/bugs/1067271 (bzr r11943) --- src/display/drawing-item.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index 0fb1f0018..1e6e44d6f 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -667,29 +667,24 @@ DrawingItem::clip(Inkscape::DrawingContext &ct, Geom::IntRect const &area) if (!_visible) return; if (!area.intersects(_bbox)) return; - // The item used as the clipping path itself has a clipping path. - // Render this item's clipping path onto a temporary surface, then composite it - // with the item using the IN operator - if (_clip) { - ct.pushAlphaGroup(); - { Inkscape::DrawingContext::Save save(ct); - ct.setSource(0,0,0,1); - _clip->clip(ct, area); - } - ct.pushAlphaGroup(); - } - + ct.setSource(0,0,0,1); + ct.pushGroup(); // rasterize the clipping path _clipItem(ct, area); - if (_clip) { + // The item used as the clipping path itself has a clipping path. + // Render this item's clipping path onto a temporary surface, then composite it + // with the item using the IN operator + ct.pushGroup(); + _clip->clip(ct, area); ct.popGroupToSource(); ct.setOperator(CAIRO_OPERATOR_IN); ct.paint(); - ct.popGroupToSource(); - ct.setOperator(CAIRO_OPERATOR_SOURCE); - ct.paint(); } + ct.popGroupToSource(); + ct.setOperator(CAIRO_OPERATOR_OVER); + ct.paint(); + ct.setSource(0,0,0,0); } /** -- cgit v1.2.3