summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
Diffstat (limited to 'core/math')
-rw-r--r--core/math/transform_2d.cpp2
-rw-r--r--core/math/transform_2d.h2
-rw-r--r--core/math/vector2.h1
3 files changed, 3 insertions, 2 deletions
diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp
index 7d00158f3d..1d0387bd45 100644
--- a/core/math/transform_2d.cpp
+++ b/core/math/transform_2d.cpp
@@ -106,7 +106,7 @@ Size2 Transform2D::get_scale() const {
return Size2(elements[0].length(), det_sign * elements[1].length());
}
-void Transform2D::set_scale(Size2 &p_scale) {
+void Transform2D::set_scale(const Size2 &p_scale) {
elements[0].normalize();
elements[1].normalize();
elements[0] *= p_scale.x;
diff --git a/core/math/transform_2d.h b/core/math/transform_2d.h
index b9e7a36fb3..c44678674a 100644
--- a/core/math/transform_2d.h
+++ b/core/math/transform_2d.h
@@ -81,7 +81,7 @@ struct Transform2D {
real_t basis_determinant() const;
Size2 get_scale() const;
- void set_scale(Size2 &p_scale);
+ void set_scale(const Size2 &p_scale);
_FORCE_INLINE_ const Vector2 &get_origin() const { return elements[2]; }
_FORCE_INLINE_ void set_origin(const Vector2 &p_origin) { elements[2] = p_origin; }
diff --git a/core/math/vector2.h b/core/math/vector2.h
index ae2d1ec660..9a214ef9b5 100644
--- a/core/math/vector2.h
+++ b/core/math/vector2.h
@@ -99,6 +99,7 @@ struct Vector2 {
Vector2 operator/(const real_t &rvalue) const;
void operator/=(const real_t &rvalue);
+ void operator/=(const Vector2 &rvalue) { *this = *this / rvalue; }
Vector2 operator-() const;