mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-29 03:07:17 +08:00
Minor cleanup
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import 'package:rive/src/core/importers/artboard_import_stack_object.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_animation.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state_direct.dart';
|
||||
import 'package:rive/src/rive_core/animation/blend_state_transition.dart';
|
||||
import 'package:rive/src/rive_core/animation/layer_state.dart';
|
||||
import 'package:rive/src/rive_core/animation/state_transition.dart';
|
||||
@ -16,8 +15,10 @@ class LayerStateImporter extends ArtboardImportStackObject {
|
||||
}
|
||||
|
||||
bool addBlendAnimation(BlendAnimation blendAnimation) {
|
||||
if (state is BlendStateDirect) {
|
||||
var blendState = state as BlendStateDirect;
|
||||
// This works because we explicitly export our transitions before our
|
||||
// animations.
|
||||
if (state is BlendState) {
|
||||
var blendState = state as BlendState;
|
||||
for (final transition
|
||||
in state.transitions.whereType<BlendStateTransition>()) {
|
||||
if (transition.exitBlendAnimationId >= 0 &&
|
||||
|
@ -10,7 +10,7 @@ abstract class BlendState<T extends BlendAnimation> extends BlendStateBase {
|
||||
|
||||
void internalAddAnimation(T animation) {
|
||||
assert(!_animations.contains(animation),
|
||||
'shouln\'t already contain the animation');
|
||||
'shouldn\'t already contain the animation');
|
||||
_animations.add(animation);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ class BlendStateDirectInstance
|
||||
? inputValue
|
||||
: animation.blendAnimation.input?.value) ??
|
||||
0;
|
||||
animation.mix = value / 100;
|
||||
animation.mix = (value / 100).clamp(0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user