summaryrefslogtreecommitdiffstats
path: root/src/variant/rect2.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-02-20 11:47:57 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-02-20 12:04:08 +0100
commit7e3321d1b2fc9f81191f53ee427d44bed6a2d923 (patch)
tree7d2abe629e5ad7d6ab76d30a39b967e506d13a84 /src/variant/rect2.cpp
parent917b0c2ca3e8363082d62acdc7dc73d77b1c68ec (diff)
downloadredot-cpp-7e3321d1b2fc9f81191f53ee427d44bed6a2d923.tar.gz
Use forward declares for vector math types
Adds operators to convert from int vector types to float vector types as done in the upstream engine implementations.
Diffstat (limited to 'src/variant/rect2.cpp')
-rw-r--r--src/variant/rect2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/variant/rect2.cpp b/src/variant/rect2.cpp
index 176a250..7ca8719 100644
--- a/src/variant/rect2.cpp
+++ b/src/variant/rect2.cpp
@@ -30,6 +30,8 @@
#include <godot_cpp/variant/rect2.hpp>
+#include <godot_cpp/variant/rect2i.hpp>
+#include <godot_cpp/variant/string.hpp>
#include <godot_cpp/variant/transform2d.hpp>
namespace godot {
@@ -268,4 +270,12 @@ next4:
return true;
}
+Rect2::operator String() const {
+ return String(position) + ", " + String(size);
+}
+
+Rect2::operator Rect2i() const {
+ return Rect2i(position, size);
+}
+
} // namespace godot