summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGilles Roudiere <gilles.roudiere@gmail.com>2017-12-23 20:08:45 +0900
committerGitHub <noreply@github.com>2017-12-23 20:08:45 +0900
commit59ec417e4a3f61896acb5873efd115518e83e356 (patch)
treef42bf94b28f636086bb4fa4120a7ad8f95960f9d /core
parent5463b5e3489ab2c43279447b66d22b4b35f92e9b (diff)
parent71f5e17680552a4a710cd3c25190584c5914720a (diff)
Merge pull request #14919 from groud/fix_grow_margin
Fixes Rect2 grow_margin not working at all
Diffstat (limited to 'core')
-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);