Skip to content

Commit

Permalink
Fix for applying wrong animation to artboard. Issue #205.
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-rosso committed Dec 16, 2019
1 parent 788c662 commit 0e815f5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions flare_dart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.3.1] - 2019-12-16 09:17:37

- Type checking when applying trim path animation. Improves robustness and helps prevent crashes when applying animations from non-matching artboards.

## [2.3.0] - 2019-12-05 17:25:03

- Support for layer effects including masking, drop shadows, inner shadows, and blurs.
Expand Down
4 changes: 2 additions & 2 deletions flare_dart/lib/animation/keyframe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ class KeyFrameStrokeColor extends KeyFrameWithInterpolation {
class KeyFrameStrokeEnd extends KeyFrameNumeric {
@override
void setValue(ActorComponent component, double value, double mix) {
if (component == null) return;
if (component is! ActorStroke) return;

ActorStroke star = component as ActorStroke;
star.trimEnd = star.trimEnd * (1.0 - mix) + value * mix;
Expand Down Expand Up @@ -1184,7 +1184,7 @@ class KeyFrameStrokeOffset extends KeyFrameNumeric {
class KeyFrameStrokeStart extends KeyFrameNumeric {
@override
void setValue(ActorComponent component, double value, double mix) {
if (component == null) return;
if (component is! ActorStroke) return;

ActorStroke star = component as ActorStroke;
star.trimStart = star.trimStart * (1.0 - mix) + value * mix;
Expand Down
2 changes: 1 addition & 1 deletion flare_dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flare_dart
description: Vector design and runtime animation.
version: 2.3.0
version: 2.3.1
author: "Rive Team <info@rive.app>"
homepage: https://github.com/2d-inc/Flare-Flutter
environment:
Expand Down
4 changes: 4 additions & 0 deletions flare_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.8.2] - 2019-12-16 09:19:22

- Clear out layers when instancing artboards to prevent animations from other artboards being applied.

## [1.8.1] - 2019-12-09 19:33:06

- Disable blur effects if they are less than a certain threshold. Skia seems to drop the whole layer if it's too close to zero (but not zero).
Expand Down
3 changes: 2 additions & 1 deletion flare_flutter/lib/flare_actor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class FlareActorRenderObject extends FlareRenderBox {

@override
void onUnload() {
_animationLayers.length = 0;
_animationLayers.clear();
}

String get filename => _filename;
Expand Down Expand Up @@ -285,6 +285,7 @@ class FlareActorRenderObject extends FlareRenderBox {
if (_controller != null) {
_controller.initialize(_artboard);
}
_animationLayers.clear();
_updateAnimation(onlyWhenMissing: true);
// Immediately update the newly instanced artboard and compute
// bounds so that the widget can take up the necessary space
Expand Down
2 changes: 1 addition & 1 deletion flare_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flare_flutter
description: Vector design and runtime animation for Flutter.
version: 1.8.1
version: 1.8.2
author: "Rive Team <info@rive.app>"
homepage: https://github.com/2d-inc/Flare-Flutter
environment:
Expand Down

0 comments on commit 0e815f5

Please sign in to comment.