summaryrefslogtreecommitdiff
path: root/libs/canvas/types.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-01-08 18:20:19 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-01-08 18:20:19 -0500
commit5cd35de56b26552200d4898c714937cb353b940b (patch)
tree262bf576561035d8ac2a16482caaaccd47d06edb /libs/canvas/types.cc
parentcf293d05934f3f8d664127967dad20877d8f9594 (diff)
prevent Rect::expand() from generating negative coordinates where there were none before
Diffstat (limited to 'libs/canvas/types.cc')
-rw-r--r--libs/canvas/types.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/canvas/types.cc b/libs/canvas/types.cc
index 7d7a495df5..9d8ed05622 100644
--- a/libs/canvas/types.cc
+++ b/libs/canvas/types.cc
@@ -95,8 +95,8 @@ Rect
Rect::expand (Distance amount) const
{
Rect r;
- r.x0 = x0 - amount;
- r.y0 = y0 - amount;
+ r.x0 = max (0.0, x0 - amount);
+ r.y0 = max (0.0, y0 - amount);
r.x1 = safe_add (x1, amount);
r.y1 = safe_add (y1, amount);
return r;