Skip to content

Commit

Permalink
Merge pull request #87459 from jsjtxietian/tween-from
Browse files Browse the repository at this point in the history
Fix passing int to tween's `from` with float property will be forced to interpolate as int
  • Loading branch information
akien-mga committed Jan 26, 2024
2 parents 62c87dc + 3c59609 commit 2a861ab
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 2a861ab

Please sign in to comment.