diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-08-21 15:33:09 +0000 |
|---|---|---|
| committer | Krzysztof Kosinski <tweenk.pl@gmail.com> | 2011-08-21 15:33:09 +0000 |
| commit | 0fc028f7050c91bfdb1a50ba8cb6462b2bf03d57 (patch) | |
| tree | 1815a638b17050a590d36c2515121cf0d5dae129 /src/display/drawing-group.cpp | |
| parent | Fix rendering glitches appearing when filtered, cached groups have (diff) | |
| download | inkscape-0fc028f7050c91bfdb1a50ba8cb6462b2bf03d57.tar.gz inkscape-0fc028f7050c91bfdb1a50ba8cb6462b2bf03d57.zip | |
Filter background rendering now matches the SVG specification.
(bzr r10347.1.37)
Diffstat (limited to 'src/display/drawing-group.cpp')
| -rw-r--r-- | src/display/drawing-group.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/display/drawing-group.cpp b/src/display/drawing-group.cpp index d9a75925e..a678c3feb 100644 --- a/src/display/drawing-group.cpp +++ b/src/display/drawing-group.cpp @@ -95,12 +95,29 @@ DrawingGroup::_updateItem(Geom::IntRect const &area, UpdateContext const &ctx, u return beststate; } -void -DrawingGroup::_renderItem(DrawingContext &ct, Geom::IntRect const &area, unsigned flags) +unsigned +DrawingGroup::_renderItem(DrawingContext &ct, Geom::IntRect const &area, unsigned flags, DrawingItem *stop_at) { - for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { - i->render(ct, area, flags); + if (stop_at == NULL) { + // normal rendering + for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { + i->render(ct, area, flags, stop_at); + } + } else { + // background rendering + for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { + if (&*i == stop_at) return RENDER_OK; // do not render the stop_at item at all + if (i->isAncestorOf(stop_at)) { + // render its ancestors without masks, opacity or filters + i->render(ct, area, flags | RENDER_FILTER_BACKGROUND, stop_at); + // stop further rendering + return RENDER_OK; + } else { + i->render(ct, area, flags, stop_at); + } + } } + return RENDER_OK; } void |
