make raise_to_top() and lower_to_bottom() no-ops if item is already in the right...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 2 Jan 2014 21:49:42 +0000 (16:49 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 2 Jan 2014 21:49:42 +0000 (16:49 -0500)
libs/canvas/group.cc

index bcea16dd767b5544f139d52a0dffad9e94cb66fc..1341408dacce21ad3530ea9fd9babbc569348f68 100644 (file)
@@ -233,6 +233,12 @@ Group::clear (bool with_delete)
 void
 Group::raise_child_to_top (Item* i)
 {
+       if (!_items.empty()) {
+               if (_items.front() == i) {
+                       return;
+               }
+       }
+
        _items.remove (i);
        _items.push_back (i);
        invalidate_lut ();
@@ -259,6 +265,11 @@ Group::raise_child (Item* i, int levels)
 void
 Group::lower_child_to_bottom (Item* i)
 {
+       if (!_items.empty()) {
+               if (_items.back() == i) {
+                       return;
+               }
+       }
        _items.remove (i);
        _items.push_front (i);
        invalidate_lut ();