mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
fix drawing of rectangles larger than 2000 pixels, caused by silly hard-coding of width limit
This commit is contained in:
parent
c6fe6b0996
commit
144fdfbbd0
1 changed files with 3 additions and 2 deletions
|
|
@ -61,12 +61,13 @@ Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con
|
||||||
|
|
||||||
Rect draw = d.get();
|
Rect draw = d.get();
|
||||||
static const double boundary = 0.5;
|
static const double boundary = 0.5;
|
||||||
|
const double x_limit = _canvas->visible_area().width();
|
||||||
|
|
||||||
draw.x0 = max (self.x0, max (0.0, draw.x0 - boundary));
|
draw.x0 = max (self.x0, max (0.0, draw.x0 - boundary));
|
||||||
draw.x1 = min (self.x1, min (2000.0, draw.x1 + boundary));
|
draw.x1 = min (self.x1, min (x_limit, draw.x1 + boundary));
|
||||||
|
|
||||||
draw.y0 = max (self.y0, max (0.0, draw.y0 - boundary));
|
draw.y0 = max (self.y0, max (0.0, draw.y0 - boundary));
|
||||||
draw.y1 = min (self.y1, min (2000.0, draw.y1 + boundary));
|
draw.y1 = min (self.y1, min (x_limit, draw.y1 + boundary));
|
||||||
|
|
||||||
Rect fill_rect = draw;
|
Rect fill_rect = draw;
|
||||||
Rect stroke_rect = fill_rect.expand (0.5);
|
Rect stroke_rect = fill_rect.expand (0.5);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue