Explorar o código

Fixes grow_margin not working at all

Gilles Roudiere %!s(int64=7) %!d(string=hai) anos
pai
achega
71f5e17680
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      core/math/math_2d.h

+ 2 - 1
core/math/math_2d.h

@@ -336,9 +336,10 @@ struct Rect2 {
 		g.size.height += p_by * 2;
 		g.size.height += p_by * 2;
 		return g;
 		return g;
 	}
 	}
+
 	inline Rect2 grow_margin(Margin p_margin, real_t p_amount) const {
 	inline Rect2 grow_margin(Margin p_margin, real_t p_amount) const {
 		Rect2 g = *this;
 		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_TOP == p_margin) ? p_amount : 0,
 				(MARGIN_RIGHT == p_margin) ? p_amount : 0,
 				(MARGIN_RIGHT == p_margin) ? p_amount : 0,
 				(MARGIN_BOTTOM == p_margin) ? p_amount : 0);
 				(MARGIN_BOTTOM == p_margin) ? p_amount : 0);