summaryrefslogtreecommitdiff
path: root/libs/canvas/rectangle.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-27 17:27:58 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-27 17:27:58 -0400
commit144fdfbbd02f6c8538bb574c96b4d05e5ca8261f (patch)
tree293e539965a1c12705a89b1a209eb2fcc9be447b /libs/canvas/rectangle.cc
parentc6fe6b09965f78a89d29f79980b8f0bcbbeddba0 (diff)
fix drawing of rectangles larger than 2000 pixels, caused by silly hard-coding of width limit
Diffstat (limited to 'libs/canvas/rectangle.cc')
-rw-r--r--libs/canvas/rectangle.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/canvas/rectangle.cc b/libs/canvas/rectangle.cc
index 2207ea80a1..a5aa0a2895 100644
--- a/libs/canvas/rectangle.cc
+++ b/libs/canvas/rectangle.cc
@@ -61,12 +61,13 @@ Rectangle::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) con
Rect draw = d.get();
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.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.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 stroke_rect = fill_rect.expand (0.5);