lots of tweaking and adding debug output including operator<</dump(ostream&) methods to help visualize canvas structure

This commit is contained in:
Paul Davis 2013-04-05 11:27:26 -04:00
parent 7db5d68cdb
commit 07a505b1b2
15 changed files with 188 additions and 23 deletions

View file

@ -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;
}
}