@@ -11,17 +11,17 @@ namespace raylib {
1111 */
1212class Rectangle : public ::Rectangle {
1313public:
14- Rectangle (const ::Rectangle& rect) : ::Rectangle{rect.x , rect.y , rect.width , rect.height } {}
14+ constexpr Rectangle (const ::Rectangle& rect) : ::Rectangle{rect.x , rect.y , rect.width , rect.height } {}
1515
16- Rectangle (float x, float y, float width, float height) : ::Rectangle{x, y, width, height} {}
17- Rectangle (float x, float y, float width) : ::Rectangle{x, y, width, 0 } {}
18- Rectangle (float x, float y) : ::Rectangle{x, y, 0 , 0 } {}
19- Rectangle (float x) : ::Rectangle{x, 0 , 0 , 0 } {}
20- Rectangle () : ::Rectangle{0 , 0 , 0 , 0 } {}
16+ constexpr Rectangle (float x, float y, float width, float height) : ::Rectangle{x, y, width, height} {}
17+ constexpr Rectangle (float x, float y, float width) : ::Rectangle{x, y, width, 0 } {}
18+ constexpr Rectangle (float x, float y) : ::Rectangle{x, y, 0 , 0 } {}
19+ constexpr Rectangle (float x) : ::Rectangle{x, 0 , 0 , 0 } {}
20+ constexpr Rectangle () : ::Rectangle{0 , 0 , 0 , 0 } {}
2121
22- Rectangle (::Vector2 position, ::Vector2 size) : ::Rectangle{position.x , position.y , size.x , size.y } {}
23- Rectangle (::Vector2 size) : ::Rectangle{0 , 0 , size.x , size.y } {}
24- Rectangle (::Vector4 rect) : ::Rectangle{rect.x , rect.y , rect.z , rect.w } {}
22+ constexpr Rectangle (::Vector2 position, ::Vector2 size) : ::Rectangle{position.x , position.y , size.x , size.y } {}
23+ constexpr Rectangle (::Vector2 size) : ::Rectangle{0 , 0 , size.x , size.y } {}
24+ constexpr Rectangle (::Vector4 rect) : ::Rectangle{rect.x , rect.y , rect.z , rect.w } {}
2525
2626 GETTERSETTER (float , X, x)
2727 GETTERSETTER (float , Y, y)
@@ -33,9 +33,9 @@ class Rectangle : public ::Rectangle {
3333 return *this ;
3434 }
3535
36- ::Vector4 ToVector4 () { return {x, y, width, height}; }
36+ constexpr ::Vector4 ToVector4 () const { return {x, y, width, height}; }
3737
38- explicit operator ::Vector4 () const { return {x, y, width, height}; }
38+ constexpr explicit operator ::Vector4 () const { return {x, y, width, height}; }
3939
4040 /* *
4141 * Draw a color-filled rectangle
0 commit comments