diff --git a/README.md b/README.md index 277e671..8b7a0ef 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository has three primary branches: - This is the branch we publish to pub from. - This branch and the associated pub packages are guaranteed to work on the flutter stable channel. ``` - flare_flutter: ^1.5.4 + flare_flutter: ^1.7.1 ``` - dev - This branch has the latest changes should work with the flutter dev channel. diff --git a/flare_dart/CHANGELOG.md b/flare_dart/CHANGELOG.md index 1dcbe83..486e378 100644 --- a/flare_dart/CHANGELOG.md +++ b/flare_dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## [2.2.5] - 2019-11-20 16:36:24 + +- Fixed gradient transformations for shapes with transformAffectsStroke set to true. + ## [2.2.4] - 2019-11-07 12:14:49 - Adding support for ActorImage.isDynamic which allows Flare to pacakge source UV coordinates for the image such that it can be swapped at runtime. This requires re-exporting files from Flare after marking the image as dynamic in the Flare UI. diff --git a/flare_dart/lib/actor_color.dart b/flare_dart/lib/actor_color.dart index 2e7a31f..15f226c 100644 --- a/flare_dart/lib/actor_color.dart +++ b/flare_dart/lib/actor_color.dart @@ -105,7 +105,7 @@ abstract class ActorColor extends ActorPaint { @override void onDirty(int dirt) {} - + @override void update(int dirt) {} } @@ -304,8 +304,13 @@ abstract class GradientColor extends ActorPaint { void update(int dirt) { ActorShape shape = parent as ActorShape; Mat2D world = shape.worldTransform; - Vec2D.transformMat2D(_renderStart, _start, world); - Vec2D.transformMat2D(_renderEnd, _end, world); + if (shape.transformAffectsStroke) { + Vec2D.copy(_renderStart, _start); + Vec2D.copy(_renderEnd, _end); + } else { + Vec2D.transformMat2D(_renderStart, _start, world); + Vec2D.transformMat2D(_renderEnd, _end, world); + } } } diff --git a/flare_dart/pubspec.yaml b/flare_dart/pubspec.yaml index 77e590b..69512c8 100644 --- a/flare_dart/pubspec.yaml +++ b/flare_dart/pubspec.yaml @@ -1,6 +1,6 @@ name: flare_dart description: Vector design and runtime animation. -version: 2.2.4 +version: 2.2.5 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: diff --git a/flare_flutter/CHANGELOG.md b/flare_flutter/CHANGELOG.md index 291c2f8..92ea1b9 100644 --- a/flare_flutter/CHANGELOG.md +++ b/flare_flutter/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.7.3] - 2019-11-20 16:37:18 + +- Fixed gradient transformations for shapes with transformAffectsStroke set to true. + +## [1.7.2] - 2019-11-18 16:30:39 + +- Fixing FlareControls to allow for completing layered animations. FlareControls would previously remove an animation once another one played after it had fully mixed in. This would cause popping when animations didn't touch the exact same keyframes. + ## [1.7.1] - 2019-11-07 15:03:39 - Backing out changeImageFromNetwork until new PaintingBinding.instance.instantiateImageCodec signature lands in stable. diff --git a/flare_flutter/lib/flare_controls.dart b/flare_flutter/lib/flare_controls.dart index d0fdee5..ed89a16 100644 --- a/flare_flutter/lib/flare_controls.dart +++ b/flare_flutter/lib/flare_controls.dart @@ -57,21 +57,18 @@ class FlareControls extends FlareController { /// the [onCompleted()] callback will be triggered. @override bool advance(FlutterActorArtboard artboard, double elapsed) { - int lastFullyMixed = -1; - double lastMix = 0.0; - /// List of completed animations during this frame. List completed = []; /// This loop will mix all the currently active animation layers so that, /// if an animation is played on top of the current one, it'll smoothly mix - /// between the two instead of immediately switching to the new one. + /// between the two instead of immediately switching to the new one. for (int i = 0; i < _animationLayers.length; i++) { FlareAnimationLayer layer = _animationLayers[i]; layer.mix += elapsed; layer.time += elapsed; - lastMix = (_mixSeconds == null || _mixSeconds == 0.0) + double mix = (_mixSeconds == null || _mixSeconds == 0.0) ? 1.0 : min(1.0, layer.mix / _mixSeconds); @@ -81,13 +78,7 @@ class FlareControls extends FlareController { } /// Apply the animation with the current mix. - layer.animation.apply(layer.time, _artboard, lastMix); - - /// Update [lastFullyMixed] with the range of fully - /// mixed animation layers. - if (lastMix == 1.0) { - lastFullyMixed = i; - } + layer.animation.apply(layer.time, _artboard, mix); /// Add (non-looping) finished animations to the list. if (layer.time > layer.animation.duration) { @@ -95,21 +86,6 @@ class FlareControls extends FlareController { } } - /// Removes the last fully mixed animation, if more than one animation is - /// present. If only one animation is playing (e.g. idle), nothing happens. - /// Since animations are added to the end of [_animationLayers], - /// everything before the last fully mixed animation can be - /// assumed to be also fully mixed too. - if (lastFullyMixed != -1) { - _animationLayers.removeRange(0, lastFullyMixed); - } - if (_animationName == null && - _animationLayers.length == 1 && - lastMix == 1.0) { - /// Remove remaining animations. - _animationLayers.removeAt(0); - } - /// Notify of the completed animations. for (final FlareAnimationLayer animation in completed) { _animationLayers.remove(animation); diff --git a/flare_flutter/pubspec.yaml b/flare_flutter/pubspec.yaml index 7aa9b62..63056bd 100644 --- a/flare_flutter/pubspec.yaml +++ b/flare_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: flare_flutter description: Vector design and runtime animation for Flutter. -version: 1.7.1 +version: 1.7.3 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: