summaryrefslogtreecommitdiff
path: root/libs/canvas/types.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-04-17 10:53:17 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-04-17 10:53:17 -0400
commitd1a05240efc9816b4358cdeab458a54048abf9be (patch)
treefa45892d3971951ec5a51d6a0526271940cb6de3 /libs/canvas/types.cc
parent96eee9e7a162e3e26dd9c1ea4d8fc1ad02a3dda9 (diff)
fix clamping of line and rect coordinates to avoid issues with cairo when drawing way outside a surface's dimensions; move various coordinate methods down to Canvas, because they don't require GTK information; make visible_area() a Canvas virtual method so that we don't have to cast to call it
Diffstat (limited to 'libs/canvas/types.cc')
-rw-r--r--libs/canvas/types.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/canvas/types.cc b/libs/canvas/types.cc
index c2612a0b2b..dfd934b126 100644
--- a/libs/canvas/types.cc
+++ b/libs/canvas/types.cc
@@ -25,9 +25,7 @@
using namespace std;
using namespace ArdourCanvas;
-Coord const ArdourCanvas::COORD_MAX = DBL_MAX;
-/* XXX: empirically arrived at */
-Coord const ArdourCanvas::CAIRO_MAX = 65536;
+Coord const ArdourCanvas::COORD_MAX = 1.7e307;
static inline Coord
safe_add (Coord a, Coord b)
@@ -132,6 +130,12 @@ ArdourCanvas::operator+ (Duple const & a, Duple const & b)
return Duple (safe_add (a.x, b.x), safe_add (a.y, b.y));
}
+bool
+ArdourCanvas::operator== (Duple const & a, Duple const & b)
+{
+ return a.x == b.x && a.y == b.y;
+}
+
Duple
ArdourCanvas::operator- (Duple const & a, Duple const & b)
{