13
0

canvas; change operator<<() for Rect to show BIG instead of gigantic 64 bit numbers

This commit is contained in:
Paul Davis 2021-07-27 12:28:45 -06:00
parent ddcd004350
commit 5b123441f4

View File

@ -39,7 +39,60 @@ ArdourCanvas::operator<< (ostream & s, Duple const & r)
ostream &
ArdourCanvas::operator<< (ostream & s, Rect const & r)
{
s << "[(" << r.x0 << ", " << r.y0 << "), (" << r.x1 << ", " << r.y1 << ") " << r.width() << " x " << r.height() << "]";
static const Coord BIG = COORD_MAX/10.0; /* 1 order of magnitude from COORD_MAX */
const Distance w = r.width();
const Distance h = r.height();
s << "[(";
if (r.x0 > BIG) {
s << "BIG";
} else {
s << r.x0;
}
s << ", ";
if (r.y0 > BIG) {
s << "BIG";
} else {
s << r.y0;
}
s << "), (";
if (r.x1 > BIG) {
s << "BIG";
} else {
s << r.x1;
}
s << ", ";
if (r.y1 > BIG) {
s << "BIG";
} else {
s << r.y1;
}
s << ") ";
if (w > BIG) {
s << "BIG";
} else {
s << w;
}
s << " x ";
if (h > BIG) {
s << "BIG";
} else {
s << h;
}
s << ']';
return s;
}