Skip to content

Commit

Permalink
Fixing gradient transformations for shapes with transformAffectsStrok…
Browse files Browse the repository at this point in the history
…e set to true.
  • Loading branch information
luigi-rosso committed Nov 21, 2019
1 parent 1e88ddf commit 9ff2b94
Show file tree
Hide file tree
Showing 5 changed files with 22 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.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.
Expand Down
11 changes: 8 additions & 3 deletions flare_dart/lib/actor_color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ abstract class ActorColor extends ActorPaint {

@override
void onDirty(int dirt) {}

@override
void update(int dirt) {}
}
Expand Down Expand Up @@ -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);
}
}
}

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.2.4
version: 2.2.5
author: "2Dimensions Team <info@2dimensions.com>"
homepage: https://github.com/2d-inc/Flare-Flutter
environment:
Expand Down
8 changes: 8 additions & 0 deletions flare_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
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.7.2
version: 1.7.3
author: "2Dimensions Team <info@2dimensions.com>"
homepage: https://github.com/2d-inc/Flare-Flutter
environment:
Expand Down

0 comments on commit 9ff2b94

Please sign in to comment.