Skip to content

Commit

Permalink
Fix pass int to tween's from with float property will be forced to in…
Browse files Browse the repository at this point in the history
…terpolate as int
  • Loading branch information
jsjtxietian committed Jan 22, 2024
1 parent 0bcc0e9 commit 3c59609
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scene/animation/tween.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,13 @@ Tween::Tween(bool p_valid) {

Ref<PropertyTweener> PropertyTweener::from(const Variant &p_value) {
ERR_FAIL_COND_V(tween.is_null(), nullptr);
if (!tween->_validate_type_match(p_value, final_val)) {

Variant from_value = p_value;
if (!tween->_validate_type_match(final_val, from_value)) {
return nullptr;
}

initial_val = p_value;
initial_val = from_value;
do_continue = false;
return this;
}
Expand Down

0 comments on commit 3c59609

Please sign in to comment.