From 7b24be86a2a9dfaa86d3c338769f4f5e55dacf24 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 2 Jan 2014 16:49:42 -0500 Subject: [PATCH] make raise_to_top() and lower_to_bottom() no-ops if item is already in the right place --- libs/canvas/group.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/canvas/group.cc b/libs/canvas/group.cc index bcea16dd76..1341408dac 100644 --- a/libs/canvas/group.cc +++ b/libs/canvas/group.cc @@ -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 ();