From 9ff2b94022b8192d71c7fdde337e0d151fd13e7d Mon Sep 17 00:00:00 2001 From: Luigi Rosso Date: Wed, 20 Nov 2019 16:38:28 -0800 Subject: [PATCH] Fixing gradient transformations for shapes with transformAffectsStroke set to true. --- flare_dart/CHANGELOG.md | 4 ++++ flare_dart/lib/actor_color.dart | 11 ++++++++--- flare_dart/pubspec.yaml | 2 +- flare_flutter/CHANGELOG.md | 8 ++++++++ flare_flutter/pubspec.yaml | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) 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/pubspec.yaml b/flare_flutter/pubspec.yaml index b012707..361cbcc 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.2 +version: 1.7.3 author: "2Dimensions Team " homepage: https://github.com/2d-inc/Flare-Flutter environment: