diff options
| author | chr <chr> | 2017-05-23 19:48:22 +0000 |
|---|---|---|
| committer | chr <chr> | 2017-05-23 19:48:22 +0000 |
| commit | dc80e5d0bf82f005628881134b929aa4838308d5 (patch) | |
| tree | 0cbe1a5aaf0673816abe5ac2674a7fc3f327b87b /src/sp-item.cpp | |
| parent | object panel: don't scroll to layer when leaving object group (diff) | |
| download | inkscape-dc80e5d0bf82f005628881134b929aa4838308d5.tar.gz inkscape-dc80e5d0bf82f005628881134b929aa4838308d5.zip | |
selection chemistry: implement z-stack order
Bug #1395452
"raise and lower objects" used to stack objects above/below the next overlapping object,
which makes it impossible to change the z-order of objects that don't overlap.
Fixes also the object manager panel
Conflicts:
src/selection-chemistry.cpp
src/selection-chemistry.h
src/sp-item.cpp
(bzr r15698.1.7)
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp index e2f678957..368f8896c 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -306,15 +306,17 @@ void SPItem::raiseToTop() { } } -void SPItem::raiseOne() { +bool SPItem::raiseOne() { auto next_higher = std::find_if(++parent->children.iterator_to(*this), parent->children.end(), &is_item); if (next_higher != parent->children.end()) { Inkscape::XML::Node *ref = next_higher->getRepr(); getRepr()->parent()->changeOrder(getRepr(), ref); + return true; } + return false; } -void SPItem::lowerOne() { +bool SPItem::lowerOne() { using Inkscape::Algorithms::find_last_if; auto next_lower = find_last_if(parent->children.begin(), parent->children.iterator_to(*this), &is_item); @@ -325,7 +327,9 @@ void SPItem::lowerOne() { ref = next_lower->getRepr(); } getRepr()->parent()->changeOrder(getRepr(), ref); + return true; } + return false; } void SPItem::lowerToBottom() { |
