mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-07-04 07:17:59 +08:00
support for interrupting transitions on state change
We are adding a flag to support interrupting transitions on state changes. Diffs= 337f9df1c support for interrupting transitions on state change (#6850) Co-authored-by: hernan <hernan@rive.app>
This commit is contained in:
@ -1 +1 @@
|
||||
e68c7b6ded17c667fe344426e54710875fc58e94
|
||||
337f9df1c04ace751fe16ed2b014477155d9cbfc
|
||||
|
@ -71,6 +71,8 @@ class StateTransition extends StateTransitionBase {
|
||||
bool get isDisabled => (flags & StateTransitionFlags.disabled) != 0;
|
||||
bool get pauseOnExit => (flags & StateTransitionFlags.pauseOnExit) != 0;
|
||||
bool get enableExitTime => (flags & StateTransitionFlags.enableExitTime) != 0;
|
||||
bool get enableEarlyExit =>
|
||||
(flags & StateTransitionFlags.enableEarlyExit) != 0;
|
||||
|
||||
/// The amount of time to mix the outgoing animation onto the incoming one
|
||||
/// when changing state. Only applies when going out from an AnimationState.
|
||||
|
@ -207,7 +207,7 @@ class LayerController {
|
||||
double _holdTime = 0;
|
||||
|
||||
bool updateState(bool ignoreTriggers) {
|
||||
if (isTransitioning) {
|
||||
if (isTransitioning && _transition!.enableEarlyExit == false) {
|
||||
return false;
|
||||
}
|
||||
_waitingForExit = false;
|
||||
|
@ -14,4 +14,7 @@ class StateTransitionFlags {
|
||||
/// Whether the animation is held at exit or if it keeps advancing during
|
||||
/// mixing.
|
||||
static const int pauseOnExit = 1 << 4;
|
||||
|
||||
/// Whether the transition can exit before it is complete.
|
||||
static const int enableEarlyExit = 1 << 5;
|
||||
}
|
||||
|
Reference in New Issue
Block a user