Skip to content

Commit

Permalink
Don't fallback to discrete animation within add_weighted() for Either<>.
Browse files Browse the repository at this point in the history
For CSS Transitions we want this case to return Err() so we know that the two
values are not interpolable.

For CSS Animations/Web Animations we implement discrete animation as the
fallback behavior when Err() is returned.
  • Loading branch information
Hiroyuki Ikezoe committed Aug 15, 2017
1 parent fa3b627 commit bff67d8
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -2410,10 +2410,7 @@ impl<T, U> Animatable for Either<T, U>
(Either::Second(ref this), Either::Second(ref other)) => {
this.add_weighted(&other, self_portion, other_portion).map(Either::Second)
},
_ => {
let result = if self_portion > other_portion {*self} else {*other};
Ok(result)
}
_ => Err(()),
}
}
}
Expand Down

0 comments on commit bff67d8

Please sign in to comment.