summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Roudiere <gilles.roudiere@gmail.com>2017-12-21 23:51:46 +0100
committerGilles Roudiere <gilles.roudiere@gmail.com>2017-12-21 23:53:31 +0100
commit71f5e17680552a4a710cd3c25190584c5914720a (patch)
tree304da0d56050e16d2f39affaf2954c2fd08b3f55
parentd510c33cd84a8cfc190cb1dce4e19f033704650e (diff)
Fixes grow_margin not working at all
-rw-r--r--core/math/math_2d.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/math/math_2d.h b/core/math/math_2d.h
index 60351445c0..bbef19de7a 100644
--- a/core/math/math_2d.h
+++ b/core/math/math_2d.h
@@ -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);