diff options
| author | Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> | 2023-11-10 21:29:45 +0900 |
|---|---|---|
| committer | Silc Lizard (Tokage) Renew <61938263+TokageItLab@users.noreply.github.com> | 2023-11-16 21:37:18 +0900 |
| commit | 80c9533810de435ba0b7ed5d7a0d5ae0f8e95e55 (patch) | |
| tree | eb322f1367027235ce6a38e9661a522a9f4ca464 /core | |
| parent | d5217b68db68d52a2f393e935fb38dde6a0f802a (diff) | |
| download | redot-engine-80c9533810de435ba0b7ed5d7a0d5ae0f8e95e55.tar.gz | |
Rework blending method in Variant animation for Int/Array/String
Diffstat (limited to 'core')
| -rw-r--r-- | core/math/rect2.h | 4 | ||||
| -rw-r--r-- | core/variant/variant.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h index 6ccb76cd10..5f403458fd 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -285,6 +285,10 @@ struct _NO_DISCARD_ Rect2 { return Rect2(Point2(position.x + MIN(size.x, (real_t)0), position.y + MIN(size.y, (real_t)0)), size.abs()); } + _FORCE_INLINE_ Rect2 round() const { + return Rect2(position.round(), size.round()); + } + Vector2 get_support(const Vector2 &p_normal) const { Vector2 half_extents = size * 0.5f; Vector2 ofs = position + half_extents; diff --git a/core/variant/variant.h b/core/variant/variant.h index 21342ae6ef..17e701cf66 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -338,6 +338,9 @@ public: _FORCE_INLINE_ bool is_num() const { return type == INT || type == FLOAT; } + _FORCE_INLINE_ bool is_string() const { + return type == STRING || type == STRING_NAME; + } _FORCE_INLINE_ bool is_array() const { return type >= ARRAY; } |
