summaryrefslogtreecommitdiff
path: root/scene/resources/rectangle_shape_2d.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-01 23:50:59 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-01 23:50:59 +0200
commit005aac2dbe2ed590e30e85424100f016c6c65fd6 (patch)
treea976723bc3c18472b13c81f607b0e8260699d80a /scene/resources/rectangle_shape_2d.cpp
parent168f6ca63b6b244273afb69163704bf3212f4206 (diff)
parentb7e2d452336ec3eff6f3393e68443773178c2910 (diff)
Merge pull request #65187 from JohanAR/vector_to_size
Diffstat (limited to 'scene/resources/rectangle_shape_2d.cpp')
-rw-r--r--scene/resources/rectangle_shape_2d.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp
index a64b262cb4..6ebf96db8e 100644
--- a/scene/resources/rectangle_shape_2d.cpp
+++ b/scene/resources/rectangle_shape_2d.cpp
@@ -41,7 +41,7 @@ void RectangleShape2D::_update_shape() {
bool RectangleShape2D::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == "extents") { // Compatibility with Godot 3.x.
// Convert to `size`, twice as big.
- set_size((Vector2)p_value * 2);
+ set_size((Size2)p_value * 2);
return true;
}
return false;
@@ -57,13 +57,13 @@ bool RectangleShape2D::_get(const StringName &p_name, Variant &r_property) const
}
#endif // DISABLE_DEPRECATED
-void RectangleShape2D::set_size(const Vector2 &p_size) {
+void RectangleShape2D::set_size(const Size2 &p_size) {
ERR_FAIL_COND_MSG(p_size.x < 0 || p_size.y < 0, "RectangleShape2D size cannot be negative.");
size = p_size;
_update_shape();
}
-Vector2 RectangleShape2D::get_size() const {
+Size2 RectangleShape2D::get_size() const {
return size;
}
@@ -106,6 +106,6 @@ void RectangleShape2D::_bind_methods() {
RectangleShape2D::RectangleShape2D() :
Shape2D(PhysicsServer2D::get_singleton()->rectangle_shape_create()) {
- size = Vector2(20, 20);
+ size = Size2(20, 20);
_update_shape();
}