diff options
| author | chr <chr> | 2017-05-23 19:48:27 +0000 |
|---|---|---|
| committer | chr <chr> | 2017-05-23 19:48:27 +0000 |
| commit | a2e04c5fb43ae6331ac34e6ea809cbb7a0a1136a (patch) | |
| tree | 4e1f05afd24fdaa486942ae5a34dc5c32d6338aa /src/selection-chemistry.cpp | |
| parent | fix a brunch of memory leaks pt.2 (diff) | |
| download | inkscape-a2e04c5fb43ae6331ac34e6ea809cbb7a0a1136a.tar.gz inkscape-a2e04c5fb43ae6331ac34e6ea809cbb7a0a1136a.zip | |
selection chemistry: cancel if we hit top/bottom
avoid unpredictable results in multi selections
(bzr r15698.1.13)
Diffstat (limited to '')
| -rw-r--r-- | src/selection-chemistry.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 7d5d921b0..b3d910700 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1150,8 +1150,12 @@ void ObjectSet::stackUp(bool skip_undo) { sort(selection.begin(), selection.end(), sp_item_repr_compare_position_bool); for (auto item: selection | boost::adaptors::reversed) { - if (!item->raiseOne()) // stop if top was reached - break; + if (!item->raiseOne()) { // stop if top was reached + if(document() && !skip_undo) + DocumentUndo::cancel(document()); + selection_display_message(desktop(), Inkscape::WARNING_MESSAGE, _("We hit top.")); + return; + } } if(document() && !skip_undo) @@ -1170,8 +1174,12 @@ void ObjectSet::stackDown(bool skip_undo) { sort(selection.begin(), selection.end(), sp_item_repr_compare_position_bool); for (auto item: selection) { - if (!item->lowerOne()) // stop if bottom was reached - break; + if (!item->lowerOne()) { // stop if bottom was reached + if(document() && !skip_undo) + DocumentUndo::cancel(document()); + selection_display_message(desktop(), Inkscape::WARNING_MESSAGE, _("We hit bottom.")); + return; + } } if(document() && !skip_undo) |
