prevent Rect::expand() from generating negative coordinates where there were none before

This commit is contained in:
Paul Davis
2014-01-08 18:20:19 -05:00
parent cf293d0593
commit 5cd35de56b

View File

@@ -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;