From 5b123441f45306ae429dd48cb667b669f2d9ba91 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 27 Jul 2021 12:28:45 -0600 Subject: [PATCH] canvas; change operator<<() for Rect to show BIG instead of gigantic 64 bit numbers --- libs/canvas/types.cc | 57 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/libs/canvas/types.cc b/libs/canvas/types.cc index 6d6d4e08c1..be5670716a 100644 --- a/libs/canvas/types.cc +++ b/libs/canvas/types.cc @@ -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; } -