mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
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
This commit is contained in:
parent
96eee9e7a1
commit
d1a05240ef
17 changed files with 98 additions and 85 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue