add GPLv2 to exec_wrapper
[ardour.git] / libs / canvas / poly_item.cc
index eeb186fd7fcf556bcd901ef7f2ac7c6542d5f400..0d3369f70b0a822ba94eaa359027aa75b6c7dd65 100644 (file)
@@ -45,7 +45,9 @@ PolyItem::compute_bounding_box () const
                
                bbox.x0 = bbox.x1 = i->x;
                bbox.y0 = bbox.y1 = i->y;
-               
+
+               ++i;
+
                while (i != _points.end()) {
                        bbox.x0 = min (bbox.x0, i->x);
                        bbox.y0 = min (bbox.y0, i->y);
@@ -54,7 +56,7 @@ PolyItem::compute_bounding_box () const
                        ++i;
                }
 
-               _bounding_box = bbox.expand (_outline_width / 2);
+               _bounding_box = bbox.expand (_outline_width);
 
                
        } else {
@@ -125,12 +127,15 @@ PolyItem::render_curve (Rect const & area, Cairo::RefPtr<Cairo::Context> context
 void
 PolyItem::set (Points const & points)
 {
-       begin_change ();
-       
-       _points = points;
-       
-       _bounding_box_dirty = true;
-       end_change ();
+       if (_points != points) {
+
+               begin_change ();
+               
+               _points = points;
+               
+               _bounding_box_dirty = true;
+               end_change ();
+       }
 }
 
 Points const &