Fix some capitalisation in the preferences dialog.
[ardour.git] / libs / canvas / item.cc
index 3c3816881ace6aeda091cfb0799207f9f70acf02..e4e3c3054667ee54143bd67435933178a5e9da2e 100644 (file)
@@ -181,6 +181,10 @@ Item::item_to_window (ArdourCanvas::Rect const & r) const
 void
 Item::set_position (Duple p)
 {
+       if (p == _position) {
+               return;
+       }
+
        boost::optional<ArdourCanvas::Rect> bbox = bounding_box ();
        boost::optional<ArdourCanvas::Rect> pre_change_parent_bounding_box;
 
@@ -236,15 +240,19 @@ Item::lower_to_bottom ()
 void
 Item::hide ()
 {
-       _visible = false;
-       _canvas->item_shown_or_hidden (this);
+       if (_visible) {
+               _visible = false;
+               _canvas->item_shown_or_hidden (this);
+       }
 }
 
 void
 Item::show ()
 {
-       _visible = true;
-       _canvas->item_shown_or_hidden (this);
+       if (!_visible) {
+               _visible = true;
+               _canvas->item_shown_or_hidden (this);
+       }
 }
 
 Duple
@@ -396,9 +404,9 @@ Item::bounding_box () const
 {
        if (_bounding_box_dirty) {
                compute_bounding_box ();
+               assert (!_bounding_box_dirty);
        }
 
-       assert (!_bounding_box_dirty);
        return _bounding_box;
 }