Skip to content

Commit

Permalink
Fix span tween system
Browse files Browse the repository at this point in the history
  • Loading branch information
Multirious committed Mar 27, 2024
1 parent 1bb2184 commit 671ebf0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/span_tween.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ pub fn span_tweener_system(
.now
.saturating_sub(tween_span.min().duration())
.min(tween_local_max);
let direction = if timer.elasped().repeat_style.is_some() {
let direction = if timer.elasped().repeat_style.is_none() {
match timer.elasped().previous.cmp(&timer.elasped().now) {
Ordering::Less => AnimationDirection::Forward,
Ordering::Equal => timer.direction,
Expand Down Expand Up @@ -762,10 +762,10 @@ pub fn span_tweener_system(
};
match new_tween_elasped {
Some(elasped) => {
let progressed = if tween_local_max > Duration::ZERO {
let tween_local_max = tween_local_max.as_secs_f32();
let progressed = if tween_local_max > 0. {
TweenProgressed(
elasped.as_secs_f32()
/ tween_local_max.as_secs_f32(),
elasped.as_secs_f32() / tween_local_max,
)
} else {
match timer.direction {
Expand Down

0 comments on commit 671ebf0

Please sign in to comment.