mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
add Rect::shrink(Distance) even though it arguably should be handled by Rect::expand()
This commit is contained in:
parent
f3d349bc9a
commit
857719f2e1
2 changed files with 19 additions and 0 deletions
|
|
@ -102,6 +102,24 @@ Rect::expand (Distance amount) const
|
|||
return r;
|
||||
}
|
||||
|
||||
Rect
|
||||
Rect::shrink (Distance amount) const
|
||||
{
|
||||
/* This isn't the equivalent of expand (-distance) because
|
||||
of the peculiarities of safe_add() with negative values.
|
||||
Maybe.
|
||||
*/
|
||||
|
||||
Rect r;
|
||||
|
||||
r.x0 = safe_add (x0, amount);
|
||||
r.y0 = safe_add (y0, amount);
|
||||
r.x1 = x1 - amount;
|
||||
r.y1 = y1 - amount;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
bool
|
||||
Rect::contains (Duple point) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue