Ensuring StateMachine animations are immediately applied when the StateMachine starts or transitions without mix time.

This commit is contained in:
Luigi Rosso
2021-05-04 13:54:06 -07:00
parent 2b5ee0a0c2
commit e7eefe4a4c
5 changed files with 134 additions and 126 deletions

View File

@ -1,3 +1,6 @@
## [0.7.6] - 2021-05-04 13:50:16
- Fixing an issue with StateMachine changes not being applied on the first frame after playing.
## [0.7.5] - 2021-04-30 14:43:29 ## [0.7.5] - 2021-04-30 14:43:29
- Fixing an issue with StateMachine exitTime from states with animations that have a work area enabled. - Fixing an issue with StateMachine exitTime from states with animations that have a work area enabled.

View File

@ -10,7 +10,7 @@
```yaml ```yaml
dependencies: dependencies:
rive: ^0.7.5 rive: ^0.7.6
``` ```
## Examples ## Examples

View File

@ -1237,13 +1237,13 @@ class RiveCoreContext {
static void setString(Core object, int propertyKey, String value) { static void setString(Core object, int propertyKey, String value) {
switch (propertyKey) { switch (propertyKey) {
case ComponentBase.namePropertyKey: case ComponentBase.namePropertyKey:
(object as ComponentBase).name = value; if (object is ComponentBase) object.name = value;
break; break;
case StateMachineComponentBase.namePropertyKey: case StateMachineComponentBase.namePropertyKey:
(object as StateMachineComponentBase).name = value; if (object is StateMachineComponentBase) object.name = value;
break; break;
case AnimationBase.namePropertyKey: case AnimationBase.namePropertyKey:
(object as AnimationBase).name = value; if (object is AnimationBase) object.name = value;
break; break;
} }
} }
@ -1251,121 +1251,121 @@ class RiveCoreContext {
static void setUint(Core object, int propertyKey, int value) { static void setUint(Core object, int propertyKey, int value) {
switch (propertyKey) { switch (propertyKey) {
case ComponentBase.parentIdPropertyKey: case ComponentBase.parentIdPropertyKey:
(object as ComponentBase).parentId = value; if (object is ComponentBase) object.parentId = value;
break; break;
case DrawTargetBase.drawableIdPropertyKey: case DrawTargetBase.drawableIdPropertyKey:
(object as DrawTargetBase).drawableId = value; if (object is DrawTargetBase) object.drawableId = value;
break; break;
case DrawTargetBase.placementValuePropertyKey: case DrawTargetBase.placementValuePropertyKey:
(object as DrawTargetBase).placementValue = value; if (object is DrawTargetBase) object.placementValue = value;
break; break;
case AnimationStateBase.animationIdPropertyKey: case AnimationStateBase.animationIdPropertyKey:
(object as AnimationStateBase).animationId = value; if (object is AnimationStateBase) object.animationId = value;
break; break;
case KeyedObjectBase.objectIdPropertyKey: case KeyedObjectBase.objectIdPropertyKey:
(object as KeyedObjectBase).objectId = value; if (object is KeyedObjectBase) object.objectId = value;
break; break;
case TransitionConditionBase.inputIdPropertyKey: case TransitionConditionBase.inputIdPropertyKey:
(object as TransitionConditionBase).inputId = value; if (object is TransitionConditionBase) object.inputId = value;
break; break;
case KeyedPropertyBase.propertyKeyPropertyKey: case KeyedPropertyBase.propertyKeyPropertyKey:
(object as KeyedPropertyBase).propertyKey = value; if (object is KeyedPropertyBase) object.propertyKey = value;
break; break;
case KeyFrameBase.framePropertyKey: case KeyFrameBase.framePropertyKey:
(object as KeyFrameBase).frame = value; if (object is KeyFrameBase) object.frame = value;
break; break;
case KeyFrameBase.interpolationTypePropertyKey: case KeyFrameBase.interpolationTypePropertyKey:
(object as KeyFrameBase).interpolationType = value; if (object is KeyFrameBase) object.interpolationType = value;
break; break;
case KeyFrameBase.interpolatorIdPropertyKey: case KeyFrameBase.interpolatorIdPropertyKey:
(object as KeyFrameBase).interpolatorId = value; if (object is KeyFrameBase) object.interpolatorId = value;
break; break;
case KeyFrameIdBase.valuePropertyKey: case KeyFrameIdBase.valuePropertyKey:
(object as KeyFrameIdBase).value = value; if (object is KeyFrameIdBase) object.value = value;
break; break;
case TransitionValueConditionBase.opValuePropertyKey: case TransitionValueConditionBase.opValuePropertyKey:
(object as TransitionValueConditionBase).opValue = value; if (object is TransitionValueConditionBase) object.opValue = value;
break; break;
case StateTransitionBase.stateToIdPropertyKey: case StateTransitionBase.stateToIdPropertyKey:
(object as StateTransitionBase).stateToId = value; if (object is StateTransitionBase) object.stateToId = value;
break; break;
case StateTransitionBase.flagsPropertyKey: case StateTransitionBase.flagsPropertyKey:
(object as StateTransitionBase).flags = value; if (object is StateTransitionBase) object.flags = value;
break; break;
case StateTransitionBase.durationPropertyKey: case StateTransitionBase.durationPropertyKey:
(object as StateTransitionBase).duration = value; if (object is StateTransitionBase) object.duration = value;
break; break;
case StateTransitionBase.exitTimePropertyKey: case StateTransitionBase.exitTimePropertyKey:
(object as StateTransitionBase).exitTime = value; if (object is StateTransitionBase) object.exitTime = value;
break; break;
case LinearAnimationBase.fpsPropertyKey: case LinearAnimationBase.fpsPropertyKey:
(object as LinearAnimationBase).fps = value; if (object is LinearAnimationBase) object.fps = value;
break; break;
case LinearAnimationBase.durationPropertyKey: case LinearAnimationBase.durationPropertyKey:
(object as LinearAnimationBase).duration = value; if (object is LinearAnimationBase) object.duration = value;
break; break;
case LinearAnimationBase.loopValuePropertyKey: case LinearAnimationBase.loopValuePropertyKey:
(object as LinearAnimationBase).loopValue = value; if (object is LinearAnimationBase) object.loopValue = value;
break; break;
case LinearAnimationBase.workStartPropertyKey: case LinearAnimationBase.workStartPropertyKey:
(object as LinearAnimationBase).workStart = value; if (object is LinearAnimationBase) object.workStart = value;
break; break;
case LinearAnimationBase.workEndPropertyKey: case LinearAnimationBase.workEndPropertyKey:
(object as LinearAnimationBase).workEnd = value; if (object is LinearAnimationBase) object.workEnd = value;
break; break;
case StrokeBase.capPropertyKey: case StrokeBase.capPropertyKey:
(object as StrokeBase).cap = value; if (object is StrokeBase) object.cap = value;
break; break;
case StrokeBase.joinPropertyKey: case StrokeBase.joinPropertyKey:
(object as StrokeBase).join = value; if (object is StrokeBase) object.join = value;
break; break;
case TrimPathBase.modeValuePropertyKey: case TrimPathBase.modeValuePropertyKey:
(object as TrimPathBase).modeValue = value; if (object is TrimPathBase) object.modeValue = value;
break; break;
case FillBase.fillRulePropertyKey: case FillBase.fillRulePropertyKey:
(object as FillBase).fillRule = value; if (object is FillBase) object.fillRule = value;
break; break;
case PathBase.pathFlagsPropertyKey: case PathBase.pathFlagsPropertyKey:
(object as PathBase).pathFlags = value; if (object is PathBase) object.pathFlags = value;
break; break;
case DrawableBase.blendModeValuePropertyKey: case DrawableBase.blendModeValuePropertyKey:
(object as DrawableBase).blendModeValue = value; if (object is DrawableBase) object.blendModeValue = value;
break; break;
case DrawableBase.drawableFlagsPropertyKey: case DrawableBase.drawableFlagsPropertyKey:
(object as DrawableBase).drawableFlags = value; if (object is DrawableBase) object.drawableFlags = value;
break; break;
case WeightBase.valuesPropertyKey: case WeightBase.valuesPropertyKey:
(object as WeightBase).values = value; if (object is WeightBase) object.values = value;
break; break;
case WeightBase.indicesPropertyKey: case WeightBase.indicesPropertyKey:
(object as WeightBase).indices = value; if (object is WeightBase) object.indices = value;
break; break;
case CubicWeightBase.inValuesPropertyKey: case CubicWeightBase.inValuesPropertyKey:
(object as CubicWeightBase).inValues = value; if (object is CubicWeightBase) object.inValues = value;
break; break;
case CubicWeightBase.inIndicesPropertyKey: case CubicWeightBase.inIndicesPropertyKey:
(object as CubicWeightBase).inIndices = value; if (object is CubicWeightBase) object.inIndices = value;
break; break;
case CubicWeightBase.outValuesPropertyKey: case CubicWeightBase.outValuesPropertyKey:
(object as CubicWeightBase).outValues = value; if (object is CubicWeightBase) object.outValues = value;
break; break;
case CubicWeightBase.outIndicesPropertyKey: case CubicWeightBase.outIndicesPropertyKey:
(object as CubicWeightBase).outIndices = value; if (object is CubicWeightBase) object.outIndices = value;
break; break;
case ClippingShapeBase.sourceIdPropertyKey: case ClippingShapeBase.sourceIdPropertyKey:
(object as ClippingShapeBase).sourceId = value; if (object is ClippingShapeBase) object.sourceId = value;
break; break;
case ClippingShapeBase.fillRulePropertyKey: case ClippingShapeBase.fillRulePropertyKey:
(object as ClippingShapeBase).fillRule = value; if (object is ClippingShapeBase) object.fillRule = value;
break; break;
case PolygonBase.pointsPropertyKey: case PolygonBase.pointsPropertyKey:
(object as PolygonBase).points = value; if (object is PolygonBase) object.points = value;
break; break;
case DrawRulesBase.drawTargetIdPropertyKey: case DrawRulesBase.drawTargetIdPropertyKey:
(object as DrawRulesBase).drawTargetId = value; if (object is DrawRulesBase) object.drawTargetId = value;
break; break;
case TendonBase.boneIdPropertyKey: case TendonBase.boneIdPropertyKey:
(object as TendonBase).boneId = value; if (object is TendonBase) object.boneId = value;
break; break;
} }
} }
@ -1373,205 +1373,205 @@ class RiveCoreContext {
static void setDouble(Core object, int propertyKey, double value) { static void setDouble(Core object, int propertyKey, double value) {
switch (propertyKey) { switch (propertyKey) {
case StateMachineNumberBase.valuePropertyKey: case StateMachineNumberBase.valuePropertyKey:
(object as StateMachineNumberBase).value = value; if (object is StateMachineNumberBase) object.value = value;
break; break;
case TransitionNumberConditionBase.valuePropertyKey: case TransitionNumberConditionBase.valuePropertyKey:
(object as TransitionNumberConditionBase).value = value; if (object is TransitionNumberConditionBase) object.value = value;
break; break;
case CubicInterpolatorBase.x1PropertyKey: case CubicInterpolatorBase.x1PropertyKey:
(object as CubicInterpolatorBase).x1 = value; if (object is CubicInterpolatorBase) object.x1 = value;
break; break;
case CubicInterpolatorBase.y1PropertyKey: case CubicInterpolatorBase.y1PropertyKey:
(object as CubicInterpolatorBase).y1 = value; if (object is CubicInterpolatorBase) object.y1 = value;
break; break;
case CubicInterpolatorBase.x2PropertyKey: case CubicInterpolatorBase.x2PropertyKey:
(object as CubicInterpolatorBase).x2 = value; if (object is CubicInterpolatorBase) object.x2 = value;
break; break;
case CubicInterpolatorBase.y2PropertyKey: case CubicInterpolatorBase.y2PropertyKey:
(object as CubicInterpolatorBase).y2 = value; if (object is CubicInterpolatorBase) object.y2 = value;
break; break;
case KeyFrameDoubleBase.valuePropertyKey: case KeyFrameDoubleBase.valuePropertyKey:
(object as KeyFrameDoubleBase).value = value; if (object is KeyFrameDoubleBase) object.value = value;
break; break;
case LinearAnimationBase.speedPropertyKey: case LinearAnimationBase.speedPropertyKey:
(object as LinearAnimationBase).speed = value; if (object is LinearAnimationBase) object.speed = value;
break; break;
case LinearGradientBase.startXPropertyKey: case LinearGradientBase.startXPropertyKey:
(object as LinearGradientBase).startX = value; if (object is LinearGradientBase) object.startX = value;
break; break;
case LinearGradientBase.startYPropertyKey: case LinearGradientBase.startYPropertyKey:
(object as LinearGradientBase).startY = value; if (object is LinearGradientBase) object.startY = value;
break; break;
case LinearGradientBase.endXPropertyKey: case LinearGradientBase.endXPropertyKey:
(object as LinearGradientBase).endX = value; if (object is LinearGradientBase) object.endX = value;
break; break;
case LinearGradientBase.endYPropertyKey: case LinearGradientBase.endYPropertyKey:
(object as LinearGradientBase).endY = value; if (object is LinearGradientBase) object.endY = value;
break; break;
case LinearGradientBase.opacityPropertyKey: case LinearGradientBase.opacityPropertyKey:
(object as LinearGradientBase).opacity = value; if (object is LinearGradientBase) object.opacity = value;
break; break;
case StrokeBase.thicknessPropertyKey: case StrokeBase.thicknessPropertyKey:
(object as StrokeBase).thickness = value; if (object is StrokeBase) object.thickness = value;
break; break;
case GradientStopBase.positionPropertyKey: case GradientStopBase.positionPropertyKey:
(object as GradientStopBase).position = value; if (object is GradientStopBase) object.position = value;
break; break;
case TrimPathBase.startPropertyKey: case TrimPathBase.startPropertyKey:
(object as TrimPathBase).start = value; if (object is TrimPathBase) object.start = value;
break; break;
case TrimPathBase.endPropertyKey: case TrimPathBase.endPropertyKey:
(object as TrimPathBase).end = value; if (object is TrimPathBase) object.end = value;
break; break;
case TrimPathBase.offsetPropertyKey: case TrimPathBase.offsetPropertyKey:
(object as TrimPathBase).offset = value; if (object is TrimPathBase) object.offset = value;
break; break;
case TransformComponentBase.rotationPropertyKey: case TransformComponentBase.rotationPropertyKey:
(object as TransformComponentBase).rotation = value; if (object is TransformComponentBase) object.rotation = value;
break; break;
case TransformComponentBase.scaleXPropertyKey: case TransformComponentBase.scaleXPropertyKey:
(object as TransformComponentBase).scaleX = value; if (object is TransformComponentBase) object.scaleX = value;
break; break;
case TransformComponentBase.scaleYPropertyKey: case TransformComponentBase.scaleYPropertyKey:
(object as TransformComponentBase).scaleY = value; if (object is TransformComponentBase) object.scaleY = value;
break; break;
case TransformComponentBase.opacityPropertyKey: case TransformComponentBase.opacityPropertyKey:
(object as TransformComponentBase).opacity = value; if (object is TransformComponentBase) object.opacity = value;
break; break;
case NodeBase.xPropertyKey: case NodeBase.xPropertyKey:
(object as NodeBase).x = value; if (object is NodeBase) object.x = value;
break; break;
case NodeBase.yPropertyKey: case NodeBase.yPropertyKey:
(object as NodeBase).y = value; if (object is NodeBase) object.y = value;
break; break;
case PathVertexBase.xPropertyKey: case PathVertexBase.xPropertyKey:
(object as PathVertexBase).x = value; if (object is PathVertexBase) object.x = value;
break; break;
case PathVertexBase.yPropertyKey: case PathVertexBase.yPropertyKey:
(object as PathVertexBase).y = value; if (object is PathVertexBase) object.y = value;
break; break;
case StraightVertexBase.radiusPropertyKey: case StraightVertexBase.radiusPropertyKey:
(object as StraightVertexBase).radius = value; if (object is StraightVertexBase) object.radius = value;
break; break;
case CubicAsymmetricVertexBase.rotationPropertyKey: case CubicAsymmetricVertexBase.rotationPropertyKey:
(object as CubicAsymmetricVertexBase).rotation = value; if (object is CubicAsymmetricVertexBase) object.rotation = value;
break; break;
case CubicAsymmetricVertexBase.inDistancePropertyKey: case CubicAsymmetricVertexBase.inDistancePropertyKey:
(object as CubicAsymmetricVertexBase).inDistance = value; if (object is CubicAsymmetricVertexBase) object.inDistance = value;
break; break;
case CubicAsymmetricVertexBase.outDistancePropertyKey: case CubicAsymmetricVertexBase.outDistancePropertyKey:
(object as CubicAsymmetricVertexBase).outDistance = value; if (object is CubicAsymmetricVertexBase) object.outDistance = value;
break; break;
case ParametricPathBase.widthPropertyKey: case ParametricPathBase.widthPropertyKey:
(object as ParametricPathBase).width = value; if (object is ParametricPathBase) object.width = value;
break; break;
case ParametricPathBase.heightPropertyKey: case ParametricPathBase.heightPropertyKey:
(object as ParametricPathBase).height = value; if (object is ParametricPathBase) object.height = value;
break; break;
case ParametricPathBase.originXPropertyKey: case ParametricPathBase.originXPropertyKey:
(object as ParametricPathBase).originX = value; if (object is ParametricPathBase) object.originX = value;
break; break;
case ParametricPathBase.originYPropertyKey: case ParametricPathBase.originYPropertyKey:
(object as ParametricPathBase).originY = value; if (object is ParametricPathBase) object.originY = value;
break; break;
case RectangleBase.cornerRadiusTLPropertyKey: case RectangleBase.cornerRadiusTLPropertyKey:
(object as RectangleBase).cornerRadiusTL = value; if (object is RectangleBase) object.cornerRadiusTL = value;
break; break;
case RectangleBase.cornerRadiusTRPropertyKey: case RectangleBase.cornerRadiusTRPropertyKey:
(object as RectangleBase).cornerRadiusTR = value; if (object is RectangleBase) object.cornerRadiusTR = value;
break; break;
case RectangleBase.cornerRadiusBLPropertyKey: case RectangleBase.cornerRadiusBLPropertyKey:
(object as RectangleBase).cornerRadiusBL = value; if (object is RectangleBase) object.cornerRadiusBL = value;
break; break;
case RectangleBase.cornerRadiusBRPropertyKey: case RectangleBase.cornerRadiusBRPropertyKey:
(object as RectangleBase).cornerRadiusBR = value; if (object is RectangleBase) object.cornerRadiusBR = value;
break; break;
case CubicMirroredVertexBase.rotationPropertyKey: case CubicMirroredVertexBase.rotationPropertyKey:
(object as CubicMirroredVertexBase).rotation = value; if (object is CubicMirroredVertexBase) object.rotation = value;
break; break;
case CubicMirroredVertexBase.distancePropertyKey: case CubicMirroredVertexBase.distancePropertyKey:
(object as CubicMirroredVertexBase).distance = value; if (object is CubicMirroredVertexBase) object.distance = value;
break; break;
case PolygonBase.cornerRadiusPropertyKey: case PolygonBase.cornerRadiusPropertyKey:
(object as PolygonBase).cornerRadius = value; if (object is PolygonBase) object.cornerRadius = value;
break; break;
case StarBase.innerRadiusPropertyKey: case StarBase.innerRadiusPropertyKey:
(object as StarBase).innerRadius = value; if (object is StarBase) object.innerRadius = value;
break; break;
case CubicDetachedVertexBase.inRotationPropertyKey: case CubicDetachedVertexBase.inRotationPropertyKey:
(object as CubicDetachedVertexBase).inRotation = value; if (object is CubicDetachedVertexBase) object.inRotation = value;
break; break;
case CubicDetachedVertexBase.inDistancePropertyKey: case CubicDetachedVertexBase.inDistancePropertyKey:
(object as CubicDetachedVertexBase).inDistance = value; if (object is CubicDetachedVertexBase) object.inDistance = value;
break; break;
case CubicDetachedVertexBase.outRotationPropertyKey: case CubicDetachedVertexBase.outRotationPropertyKey:
(object as CubicDetachedVertexBase).outRotation = value; if (object is CubicDetachedVertexBase) object.outRotation = value;
break; break;
case CubicDetachedVertexBase.outDistancePropertyKey: case CubicDetachedVertexBase.outDistancePropertyKey:
(object as CubicDetachedVertexBase).outDistance = value; if (object is CubicDetachedVertexBase) object.outDistance = value;
break; break;
case ArtboardBase.widthPropertyKey: case ArtboardBase.widthPropertyKey:
(object as ArtboardBase).width = value; if (object is ArtboardBase) object.width = value;
break; break;
case ArtboardBase.heightPropertyKey: case ArtboardBase.heightPropertyKey:
(object as ArtboardBase).height = value; if (object is ArtboardBase) object.height = value;
break; break;
case ArtboardBase.xPropertyKey: case ArtboardBase.xPropertyKey:
(object as ArtboardBase).x = value; if (object is ArtboardBase) object.x = value;
break; break;
case ArtboardBase.yPropertyKey: case ArtboardBase.yPropertyKey:
(object as ArtboardBase).y = value; if (object is ArtboardBase) object.y = value;
break; break;
case ArtboardBase.originXPropertyKey: case ArtboardBase.originXPropertyKey:
(object as ArtboardBase).originX = value; if (object is ArtboardBase) object.originX = value;
break; break;
case ArtboardBase.originYPropertyKey: case ArtboardBase.originYPropertyKey:
(object as ArtboardBase).originY = value; if (object is ArtboardBase) object.originY = value;
break; break;
case BoneBase.lengthPropertyKey: case BoneBase.lengthPropertyKey:
(object as BoneBase).length = value; if (object is BoneBase) object.length = value;
break; break;
case RootBoneBase.xPropertyKey: case RootBoneBase.xPropertyKey:
(object as RootBoneBase).x = value; if (object is RootBoneBase) object.x = value;
break; break;
case RootBoneBase.yPropertyKey: case RootBoneBase.yPropertyKey:
(object as RootBoneBase).y = value; if (object is RootBoneBase) object.y = value;
break; break;
case SkinBase.xxPropertyKey: case SkinBase.xxPropertyKey:
(object as SkinBase).xx = value; if (object is SkinBase) object.xx = value;
break; break;
case SkinBase.yxPropertyKey: case SkinBase.yxPropertyKey:
(object as SkinBase).yx = value; if (object is SkinBase) object.yx = value;
break; break;
case SkinBase.xyPropertyKey: case SkinBase.xyPropertyKey:
(object as SkinBase).xy = value; if (object is SkinBase) object.xy = value;
break; break;
case SkinBase.yyPropertyKey: case SkinBase.yyPropertyKey:
(object as SkinBase).yy = value; if (object is SkinBase) object.yy = value;
break; break;
case SkinBase.txPropertyKey: case SkinBase.txPropertyKey:
(object as SkinBase).tx = value; if (object is SkinBase) object.tx = value;
break; break;
case SkinBase.tyPropertyKey: case SkinBase.tyPropertyKey:
(object as SkinBase).ty = value; if (object is SkinBase) object.ty = value;
break; break;
case TendonBase.xxPropertyKey: case TendonBase.xxPropertyKey:
(object as TendonBase).xx = value; if (object is TendonBase) object.xx = value;
break; break;
case TendonBase.yxPropertyKey: case TendonBase.yxPropertyKey:
(object as TendonBase).yx = value; if (object is TendonBase) object.yx = value;
break; break;
case TendonBase.xyPropertyKey: case TendonBase.xyPropertyKey:
(object as TendonBase).xy = value; if (object is TendonBase) object.xy = value;
break; break;
case TendonBase.yyPropertyKey: case TendonBase.yyPropertyKey:
(object as TendonBase).yy = value; if (object is TendonBase) object.yy = value;
break; break;
case TendonBase.txPropertyKey: case TendonBase.txPropertyKey:
(object as TendonBase).tx = value; if (object is TendonBase) object.tx = value;
break; break;
case TendonBase.tyPropertyKey: case TendonBase.tyPropertyKey:
(object as TendonBase).ty = value; if (object is TendonBase) object.ty = value;
break; break;
} }
} }
@ -1579,13 +1579,13 @@ class RiveCoreContext {
static void setColor(Core object, int propertyKey, int value) { static void setColor(Core object, int propertyKey, int value) {
switch (propertyKey) { switch (propertyKey) {
case KeyFrameColorBase.valuePropertyKey: case KeyFrameColorBase.valuePropertyKey:
(object as KeyFrameColorBase).value = value; if (object is KeyFrameColorBase) object.value = value;
break; break;
case SolidColorBase.colorValuePropertyKey: case SolidColorBase.colorValuePropertyKey:
(object as SolidColorBase).colorValue = value; if (object is SolidColorBase) object.colorValue = value;
break; break;
case GradientStopBase.colorValuePropertyKey: case GradientStopBase.colorValuePropertyKey:
(object as GradientStopBase).colorValue = value; if (object is GradientStopBase) object.colorValue = value;
break; break;
} }
} }
@ -1593,25 +1593,25 @@ class RiveCoreContext {
static void setBool(Core object, int propertyKey, bool value) { static void setBool(Core object, int propertyKey, bool value) {
switch (propertyKey) { switch (propertyKey) {
case LinearAnimationBase.enableWorkAreaPropertyKey: case LinearAnimationBase.enableWorkAreaPropertyKey:
(object as LinearAnimationBase).enableWorkArea = value; if (object is LinearAnimationBase) object.enableWorkArea = value;
break; break;
case StateMachineBoolBase.valuePropertyKey: case StateMachineBoolBase.valuePropertyKey:
(object as StateMachineBoolBase).value = value; if (object is StateMachineBoolBase) object.value = value;
break; break;
case ShapePaintBase.isVisiblePropertyKey: case ShapePaintBase.isVisiblePropertyKey:
(object as ShapePaintBase).isVisible = value; if (object is ShapePaintBase) object.isVisible = value;
break; break;
case StrokeBase.transformAffectsStrokePropertyKey: case StrokeBase.transformAffectsStrokePropertyKey:
(object as StrokeBase).transformAffectsStroke = value; if (object is StrokeBase) object.transformAffectsStroke = value;
break; break;
case PointsPathBase.isClosedPropertyKey: case PointsPathBase.isClosedPropertyKey:
(object as PointsPathBase).isClosed = value; if (object is PointsPathBase) object.isClosed = value;
break; break;
case RectangleBase.linkCornerRadiusPropertyKey: case RectangleBase.linkCornerRadiusPropertyKey:
(object as RectangleBase).linkCornerRadius = value; if (object is RectangleBase) object.linkCornerRadius = value;
break; break;
case ClippingShapeBase.isVisiblePropertyKey: case ClippingShapeBase.isVisiblePropertyKey:
(object as ClippingShapeBase).isVisible = value; if (object is ClippingShapeBase) object.isVisible = value;
break; break;
} }
} }

View File

@ -33,11 +33,7 @@ class LayerController {
_changeState(null); _changeState(null);
} }
bool apply(StateMachineController machineController, CoreContext core, void _updateMix(double elapsedSeconds) {
double elapsedSeconds, HashMap<int, dynamic> inputValues) {
if (_animationInstance != null) {
_animationInstance!.advance(elapsedSeconds);
}
if (_transition != null && if (_transition != null &&
_stateFrom != null && _stateFrom != null &&
_transition!.duration != 0) { _transition!.duration != 0) {
@ -47,6 +43,14 @@ class LayerController {
} else { } else {
_mix = 1; _mix = 1;
} }
}
bool apply(StateMachineController machineController, CoreContext core,
double elapsedSeconds, HashMap<int, dynamic> inputValues) {
if (_animationInstance != null) {
_animationInstance!.advance(elapsedSeconds);
}
_updateMix(elapsedSeconds);
if (_animationInstanceFrom != null && _mix < 1) { if (_animationInstanceFrom != null && _mix < 1) {
if (!_holdAnimationFrom) { if (!_holdAnimationFrom) {
_animationInstanceFrom!.advance(elapsedSeconds); _animationInstanceFrom!.advance(elapsedSeconds);
@ -133,6 +137,7 @@ class LayerController {
_animationInstance = null; _animationInstance = null;
} }
_mix = 0; _mix = 0;
_updateMix(0.0);
} else { } else {
_animationInstance = null; _animationInstance = null;
} }

View File

@ -1,6 +1,6 @@
name: rive name: rive
description: Rive 2 Flutter Runtime. This package provides runtime functionality for playing back and interacting with animations built with the Rive editor available at https://rive.app. description: Rive 2 Flutter Runtime. This package provides runtime functionality for playing back and interacting with animations built with the Rive editor available at https://rive.app.
version: 0.7.5 version: 0.7.6
repository: https://github.com/rive-app/rive-flutter repository: https://github.com/rive-app/rive-flutter
homepage: https://rive.app homepage: https://rive.app