using namespace std;
using namespace ArdourCanvas;
-PolyItem::PolyItem (Group* parent)
- : Item (parent)
- , Outline (parent)
+PolyItem::PolyItem (Canvas* c)
+ : Item (c)
{
+}
+PolyItem::PolyItem (Item* parent)
+ : Item (parent)
+{
}
void
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);
++i;
}
- _bounding_box = bbox.expand (_outline_width / 2);
+ _bounding_box = bbox.expand (_outline_width + 0.5);
} else {
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 &