fix clamping of line and rect coordinates to avoid issues with cairo when drawing...
[ardour.git] / libs / canvas / types.cc
index c2612a0b2b9b34418817e4f6f650ec79959a9b69..dfd934b126f7bbfd47d13bd11dbb9edfd31f3868 100644 (file)
@@ -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)
 {