Merge pull request #14919 from groud/fix_grow_margin

Fixes Rect2 grow_margin not working at all
This commit is contained in:
Gilles Roudiere 2017-12-23 20:08:45 +09:00 committed by GitHub
commit 59ec417e4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -336,9 +336,10 @@ struct Rect2 {
g.size.height += p_by * 2;
return g;
}
inline Rect2 grow_margin(Margin p_margin, real_t p_amount) const {
Rect2 g = *this;
g.grow_individual((MARGIN_LEFT == p_margin) ? p_amount : 0,
g = g.grow_individual((MARGIN_LEFT == p_margin) ? p_amount : 0,
(MARGIN_TOP == p_margin) ? p_amount : 0,
(MARGIN_RIGHT == p_margin) ? p_amount : 0,
(MARGIN_BOTTOM == p_margin) ? p_amount : 0);