diff options
| author | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2017-07-30 19:07:04 -0400 |
|---|---|---|
| committer | Wilson E. Alvarez <wilson.e.alvarez1@gmail.com> | 2017-08-08 21:43:19 -0400 |
| commit | 6d112a68b685cde609d0d90b2c57f2db6a7b9df6 (patch) | |
| tree | 46a49619034e5e3f41fd3447c4c5727bfbfcdd64 /core/math/math_2d.h | |
| parent | 950b205609ce41ab4804196a125e91274eb20258 (diff) | |
| download | redot-engine-6d112a68b685cde609d0d90b2c57f2db6a7b9df6.tar.gz | |
Moved member variables from constructor to initialization list
Diffstat (limited to 'core/math/math_2d.h')
| -rw-r--r-- | core/math/math_2d.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 780bb532d7..b679371e03 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -378,13 +378,13 @@ struct Rect2 { operator String() const { return String(position) + ", " + String(size); } Rect2() {} - Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) { - position = Point2(p_x, p_y); - size = Size2(p_width, p_height); + Rect2(real_t p_x, real_t p_y, real_t p_width, real_t p_height) + : position(Point2(p_x, p_y)), + size(Size2(p_width, p_height)) { } - Rect2(const Point2 &p_pos, const Size2 &p_size) { - position = p_pos; - size = p_size; + Rect2(const Point2 &p_pos, const Size2 &p_size) + : position(p_pos), + size(p_size) { } }; @@ -571,18 +571,18 @@ struct Rect2i { operator String() const { return String(position) + ", " + String(size); } operator Rect2() const { return Rect2(position, size); } - Rect2i(const Rect2 &p_r2) { - position = p_r2.position; - size = p_r2.size; + Rect2i(const Rect2 &p_r2) + : position(p_r2.position), + size(p_r2.size) { } Rect2i() {} - Rect2i(int p_x, int p_y, int p_width, int p_height) { - position = Point2(p_x, p_y); - size = Size2(p_width, p_height); + Rect2i(int p_x, int p_y, int p_width, int p_height) + : position(Point2(p_x, p_y)), + size(Size2(p_width, p_height)) { } - Rect2i(const Point2 &p_pos, const Size2 &p_size) { - position = p_pos; - size = p_size; + Rect2i(const Point2 &p_pos, const Size2 &p_size) + : position(p_pos), + size(p_size) { } }; |
