diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-05 11:27:26 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-05 11:27:26 -0400 |
commit | 07a505b1b271f64a1ffb2da32da0548d32cd13de (patch) | |
tree | 82b5d1ac8a5e825791fbfcc5789f6fa0aba290ae /libs/canvas/poly_item.cc | |
parent | 7db5d68cdb1c7b6138907cb732e913ec91212e13 (diff) |
lots of tweaking and adding debug output including operator<</dump(ostream&) methods to help visualize canvas structure
Diffstat (limited to 'libs/canvas/poly_item.cc')
-rw-r--r-- | libs/canvas/poly_item.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/canvas/poly_item.cc b/libs/canvas/poly_item.cc index 1fb2c6c8b8..e43d48fa8d 100644 --- a/libs/canvas/poly_item.cc +++ b/libs/canvas/poly_item.cc @@ -1,7 +1,10 @@ #include <algorithm> + #include "pbd/xml++.h" #include "pbd/compose.h" + #include "canvas/poly_item.h" +#include "canvas/canvas.h" using namespace std; using namespace ArdourCanvas; @@ -33,6 +36,7 @@ PolyItem::compute_bounding_box () const } } + if (!have_one) { _bounding_box = boost::optional<Rect> (); } else { @@ -99,3 +103,14 @@ PolyItem::set_poly_item_state (XMLNode const * node) _bounding_box_dirty = true; } + +void +PolyItem::dump (ostream& o) const +{ + Item::dump (o); + + o << _canvas->indent() << _points.size() << " points" << endl; + for (Points::const_iterator i = _points.begin(); i != _points.end(); ++i) { + o << i->x << ", " << i->y << endl; + } +} |