From c911f4114f344146ef273224d651e18d2d67725f Mon Sep 17 00:00:00 2001 From: Luigi Rosso Date: Wed, 20 Nov 2019 16:41:08 -0800 Subject: [PATCH] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 9ff2b94022b8192d71c7fdde337e0d151fd13e7d Author: Luigi Rosso Date: Wed Nov 20 16:38:28 2019 -0800 Fixing gradient transformations for shapes with transformAffectsStroke set to true. commit 1e88ddf5ca23b7d4952853a9b90db31441c5cc3a Merge: c7758eb 17f73ec Author: Luigi Rosso Date: Mon Nov 18 16:32:28 2019 -0800 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter commit c7758eb0b069de813b36e487e340ab511ab62a25 Author: Luigi Rosso Date: Mon Nov 18 16:32:23 2019 -0800 Fixing FlareControls. commit 17f73ec8a23a9129d029d3ed1f78072475909435 Author: Umberto Sonnino Date: Fri Nov 15 11:09:51 2019 +0000 Update README with latest version commit c9f434180a766600121f493f62c485963d171231 Author: Luigi Rosso Date: Thu Nov 7 15:05:04 2019 -0800 Backing out changeImageFromNetwork. Issue #183 commit e9712a4244eefe96e8b4644be1a6e8eb0d3feae1 Author: Luigi Rosso Date: Thu Nov 7 12:32:17 2019 -0800 Bumping versions. commit 366cdc03cef7110f9247b4de332a12f40d987f32 Author: Luigi Rosso Date: Thu Nov 7 12:27:53 2019 -0800 Adding support for runtime image swapping, requires marking image nodes as isDynamic in Flare. Issue #183. commit 53a7c659b772f5b9442f569be0a389512a77ff29 Author: Luigi Rosso Date: Wed Nov 6 17:30:42 2019 -0800 Updating flare_flutter version. commit b391dd4343b710fa575b45c47d11aca8b3cb4b52 Merge: 1e9b22e 9ec074b Author: Luigi Rosso Date: Wed Nov 6 17:28:34 2019 -0800 Merge branch 'warmth_fix' commit 9ec074be6328914ebcd82e5285c9aef9e408e1d5 Author: Luigi Rosso Date: Wed Nov 6 15:43:31 2019 -0800 Call setState if mounted. commit c66ac647efac650ef38b425fa7488343e36a075f Author: Luigi Rosso Date: Wed Nov 6 15:38:06 2019 -0800 Addressing an issue found in #177 with FlareCacheBuilder setting state when widget is no longer mounted. commit 1e9b22e0aa12e27c362fcaf28d914aa482198db9 Author: Umberto Sonnino Date: Wed Nov 6 19:02:25 2019 +0100 Init mat before inverting commit bc07b8752c05bd1a05cfcded0c2193e23602a1e0 Author: Umberto Sonnino Date: Wed Nov 6 19:00:13 2019 +0100 Remove local flare_dart from examples pubspec #184 commit e1cca7cdc97bdfb1fd19d2ee365ce901c1e8339a Author: Luigi Rosso Date: Tue Oct 29 12:50:30 2019 -0700 Bumping versions, merging optimal_load branch, and persisting settings in checkbox example. commit 55cae393bb92dcd7157a5b12c55074e3bafa6d6d Author: Luigi Rosso Date: Tue Oct 29 12:41:43 2019 -0700 Copy transform affects stroke properly when instancing shapes. commit 43716dd3449266fe9f6f42c5bf05701d0bb06b88 Author: Luigi Rosso Date: Mon Oct 28 12:52:09 2019 -0700 Prevent coldLoad (async) from happening when widget isn’t ready to load. commit 506837e0bafff3060318bc65d03296ebb599f284 Author: Luigi Rosso Date: Fri Oct 25 13:00:56 2019 -0700 Improving loading. commit 9ee95b964dde6ee3fb17b9e969ab00b3d0992c9f Author: Luigi Rosso Date: Fri Oct 25 10:42:42 2019 -0700 Make sure overrideColor is set even when drawableNodes is null. commit 7d59de1e77c040acc271bc3981a70517856a31b1 Author: Umberto Sonnino Date: Fri Oct 25 13:15:34 2019 +0100 Move null check commit 528af53a2bc9ac68d00fc30aadb2f78509fff922 Author: Umberto Sonnino Date: Fri Oct 25 13:10:17 2019 +0100 Insert null checks for artboards with no drawables #178 commit 33f23a7d29b5adf04f5b6536ddaf74f1aa590165 Author: Umberto Sonnino Date: Fri Oct 25 12:16:16 2019 +0100 Remove GradientColor override of ActorPaint opacity getter #179 commit 59ba2f08174b43c7a7f8a7ff97cd04d533da1eea Author: Umberto Sonnino Date: Thu Oct 24 09:31:41 2019 +0100 Document the `actor_animatino.apply()` function commit d77438f87f7aae2d850a8295ae4d9a5b33505694 Author: Umberto Sonnino Date: Thu Oct 24 09:31:10 2019 +0100 Fix division by 0 on transform constraint commit f0cf988bc3ef928b8b96ae217133ecadca02b418 Author: Luigi Rosso Date: Fri Oct 11 12:59:13 2019 -0700 Fix reading of JSON clip values. Issue #172 commit a7796e0d6e9b5ea6957eafc9f784ba4c36320967 Author: Luigi Rosso Date: Fri Oct 11 12:39:48 2019 -0700 Mitigating issue #172. commit 373c14a4f3b2360c4252a8ac834c23bb28068f6e Author: Luigi Rosso Date: Wed Oct 9 14:21:47 2019 -0700 Fixing issue with image clipping. commit ae1c901441306953f09549b4c3bdd4612cc86af4 Author: Luigi Rosso Date: Wed Oct 9 11:19:16 2019 -0700 Fix merge bugs. commit d8cb780a543fe9fd35d60bcfcb198b70622c524f Author: Luigi Rosso Date: Wed Oct 9 11:09:42 2019 -0700 Adding support for difference clipping. commit bf99a765746f321937315e7ecd96aaa190a3d20b Author: Luigi Rosso Date: Tue Oct 8 19:07:26 2019 -0700 Matching stable version commit 9becc744d0d50f10533e3ad1f7c0b4daee6604c2 Author: Luigi Rosso Date: Tue Oct 8 13:58:11 2019 -0700 Bumping flare_dart to 2.0 due to breaking changes. commit 0a292cc67ea8d261057b9f9e5c32028e3436436c Author: Luigi Rosso Date: Tue Oct 8 13:39:57 2019 -0700 Bumping versions and changelogs. commit 431a98e4804efe6d073a9b55a9ce1a5f23c7ca4d Author: Luigi Rosso Date: Tue Oct 8 13:35:26 2019 -0700 Fixing up analysis issues for #169 commit 72fb6fc743ed3a241c7c51e5a8ebc90836f734ba Merge: 4d00202 dc68dea Author: Luigi Rosso Date: Tue Oct 8 13:02:17 2019 -0700 Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter commit 4d00202a4f24b2c3d581b28cb15b953ec91c9f3c Author: Luigi Rosso Date: Tue Oct 8 13:02:11 2019 -0700 Cleaning up analysis issues. commit dc68dea6d57cb504d1a867c7e4c5b6768ec5dfe2 Merge: 5ca8d49 f1d9749 Author: Luigi Rosso Date: Tue Oct 8 11:06:53 2019 -0700 Merge pull request #168 from mehmetf/master Escalate the severity of unused imports in analyzer commit f1d97496a2679f470202f17298cd76a0411d7a8c Author: Mehmet Fidanboylu Date: Tue Oct 8 10:20:58 2019 -0700 Do the same changes to flare_dart commit 64f395edf7c6f8419a7a461e46664ff3723cfa78 Author: Mehmet Fidanboylu Date: Tue Oct 8 10:17:51 2019 -0700 Escalate the severity of unused imports in analyzer commit 5ca8d49c09406d1ac62ffffd4d0c5082744be7a3 Author: Luigi Rosso Date: Mon Oct 7 11:22:38 2019 -0700 Bumping versions and changelog. commit 874ce8e0b77a8ffc3eea9027cb31e2b75437da01 Author: Luigi Rosso Date: Mon Oct 7 11:20:28 2019 -0700 Adding support for nodes inside of shapes. commit 4d06431f341b426dd5cc41529a49c115e6354c51 Author: Luigi Rosso Date: Fri Oct 4 18:06:09 2019 -0700 Introducing FlareTesting.setup(); commit 2c5f4200535d679fd3092d1b6aa15ff71d85b869 Author: Luigi Rosso Date: Fri Oct 4 13:44:25 2019 -0700 Clamping trim start/end. commit daba34d11233391e7277b157bc117b8bbb626982 Author: Luigi Rosso Date: Mon Sep 30 21:21:55 2019 +0200 Cherry picking critical lints from #1 63 and updating for pub. --- README.md | 2 +- flare_dart/CHANGELOG.md | 4 ++++ flare_dart/lib/actor_color.dart | 11 +++++++--- flare_dart/pubspec.yaml | 2 +- flare_flutter/CHANGELOG.md | 8 +++++++ flare_flutter/lib/flare_controls.dart | 30 +++------------------------ flare_flutter/pubspec.yaml | 2 +- 7 files changed, 26 insertions(+), 33 deletions(-) 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: