Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 86b8f41
Author: Luigi Rosso <[email protected]>
Date:   Wed Oct 9 14:26:06 2019 -0700

    Squashed commit of the following:

    commit 373c14a
    Author: Luigi Rosso <[email protected]>
    Date:   Wed Oct 9 14:21:47 2019 -0700

        Fixing issue with image clipping.

    commit ae1c901
    Author: Luigi Rosso <[email protected]>
    Date:   Wed Oct 9 11:19:16 2019 -0700

        Fix merge bugs.

    commit d8cb780
    Author: Luigi Rosso <[email protected]>
    Date:   Wed Oct 9 11:09:42 2019 -0700

        Adding support for difference clipping.

    commit bf99a76
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 19:07:26 2019 -0700

        Matching stable version

    commit 9becc74
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:58:11 2019 -0700

        Bumping flare_dart to 2.0 due to breaking changes.

    commit 0a292cc
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:39:57 2019 -0700

        Bumping versions and changelogs.

    commit 431a98e
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:35:26 2019 -0700

        Fixing up analysis issues for #169

    commit 72fb6fc
    Merge: 4d00202 dc68dea
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:02:17 2019 -0700

        Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter

    commit 4d00202
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:02:11 2019 -0700

        Cleaning up analysis issues.

    commit dc68dea
    Merge: 5ca8d49 f1d9749
    Author: Luigi Rosso <[email protected]>
    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 f1d9749
    Author: Mehmet Fidanboylu <[email protected]>
    Date:   Tue Oct 8 10:20:58 2019 -0700

        Do the same changes to flare_dart

    commit 64f395e
    Author: Mehmet Fidanboylu <[email protected]>
    Date:   Tue Oct 8 10:17:51 2019 -0700

        Escalate the severity of unused imports in analyzer

    commit 5ca8d49
    Author: Luigi Rosso <[email protected]>
    Date:   Mon Oct 7 11:22:38 2019 -0700

        Bumping versions and changelog.

    commit 874ce8e
    Author: Luigi Rosso <[email protected]>
    Date:   Mon Oct 7 11:20:28 2019 -0700

        Adding support for nodes inside of shapes.

    commit 4d06431
    Author: Luigi Rosso <[email protected]>
    Date:   Fri Oct 4 18:06:09 2019 -0700

        Introducing FlareTesting.setup();

    commit 2c5f420
    Author: Luigi Rosso <[email protected]>
    Date:   Fri Oct 4 13:44:25 2019 -0700

        Clamping trim start/end.

    commit daba34d
    Author: Luigi Rosso <[email protected]>
    Date:   Mon Sep 30 21:21:55 2019 +0200

        Cherry picking critical lints from #1 63 and updating for pub.

commit 63b7b2c
Author: Luigi Rosso <[email protected]>
Date:   Wed Oct 9 11:18:18 2019 -0700

    Fixing merge issues.

commit ea16c60
Author: Luigi Rosso <[email protected]>
Date:   Wed Oct 9 11:10:54 2019 -0700

    Squashed commit of the following:

    commit d8cb780
    Author: Luigi Rosso <[email protected]>
    Date:   Wed Oct 9 11:09:42 2019 -0700

        Adding support for difference clipping.

    commit bf99a76
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 19:07:26 2019 -0700

        Matching stable version

    commit 9becc74
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:58:11 2019 -0700

        Bumping flare_dart to 2.0 due to breaking changes.

    commit 0a292cc
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:39:57 2019 -0700

        Bumping versions and changelogs.

    commit 431a98e
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:35:26 2019 -0700

        Fixing up analysis issues for #169

    commit 72fb6fc
    Merge: 4d00202 dc68dea
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:02:17 2019 -0700

        Merge branch 'master' of https://github.com/2d-inc/Flare-Flutter

    commit 4d00202
    Author: Luigi Rosso <[email protected]>
    Date:   Tue Oct 8 13:02:11 2019 -0700

        Cleaning up analysis issues.

    commit dc68dea
    Merge: 5ca8d49 f1d9749
    Author: Luigi Rosso <[email protected]>
    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 f1d9749
    Author: Mehmet Fidanboylu <[email protected]>
    Date:   Tue Oct 8 10:20:58 2019 -0700

        Do the same changes to flare_dart

    commit 64f395e
    Author: Mehmet Fidanboylu <[email protected]>
    Date:   Tue Oct 8 10:17:51 2019 -0700

        Escalate the severity of unused imports in analyzer

    commit 5ca8d49
    Author: Luigi Rosso <[email protected]>
    Date:   Mon Oct 7 11:22:38 2019 -0700

        Bumping versions and changelog.

    commit 874ce8e
    Author: Luigi Rosso <[email protected]>
    Date:   Mon Oct 7 11:20:28 2019 -0700

        Adding support for nodes inside of shapes.

    commit 4d06431
    Author: Luigi Rosso <[email protected]>
    Date:   Fri Oct 4 18:06:09 2019 -0700

        Introducing FlareTesting.setup();

    commit 2c5f420
    Author: Luigi Rosso <[email protected]>
    Date:   Fri Oct 4 13:44:25 2019 -0700

        Clamping trim start/end.

    commit daba34d
    Author: Luigi Rosso <[email protected]>
    Date:   Mon Sep 30 21:21:55 2019 +0200

        Cherry picking critical lints from #1 63 and updating for pub.
  • Loading branch information
luigi-rosso committed Oct 9, 2019
1 parent 7eb56d7 commit f695594
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 54 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.0] - 2019-10-09 11:19:06

- Fix merge bug that sneaked into pub.

## [2.1.0] - 2019-10-09 11:08:05

- Adding support for difference clipping.
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.6.1] - 2019-10-09 14:20:54

- Image and Shapes share clipping logic. Fixes issue with image clipping.

## [1.6.0] - 2019-10-09 11:08:52

- Using latest flare_dart with support for difference clipping.
Expand Down
101 changes: 48 additions & 53 deletions flare_flutter/lib/flare.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,51 @@ abstract class FlutterActorDrawable {
void onBlendModeChanged(ui.BlendMode blendMode);

void draw(ui.Canvas canvas);

List<List<ClipShape>> get clipShapes;
ActorArtboard get artboard;

void clip(ui.Canvas canvas) {
for (final List<ClipShape> clips in clipShapes) {
for (final ClipShape clipShape in clips) {
var shape = clipShape.shape;
if (shape.renderCollapsed) {
continue;
}
if (clipShape.intersect) {
canvas.clipPath((shape as FlutterActorShape).path);
} else {
var artboardRect = Rect.fromLTWH(
artboard.origin[0] * artboard.width,
artboard.origin[1] * artboard.height,
artboard.width,
artboard.height);

if (shape.fill != null && shape.fill.fillRule == FillRule.evenOdd) {
// One single clip path with subtraction rect and all sub paths.
var clipPath = ui.Path();
clipPath.addRect(artboardRect);
for (final path in shape.paths) {
clipPath.addPath((path as FlutterPath).path, ui.Offset.zero,
matrix4: path.pathTransform?.mat4);
}
clipPath.fillType = PathFillType.evenOdd;
canvas.clipPath(clipPath);
} else {
// One clip path with rect per shape path.
for (final path in shape.paths) {
var clipPath = ui.Path();
clipPath.addRect(artboardRect);
clipPath.addPath((path as FlutterPath).path, ui.Offset.zero,
matrix4: path.pathTransform?.mat4);
clipPath.fillType = PathFillType.evenOdd;
canvas.clipPath(clipPath);
}
}
}
}
}
}
}

abstract class FlutterFill {
Expand Down Expand Up @@ -231,46 +276,7 @@ class FlutterActorShape extends ActorShape with FlutterActorDrawable {

canvas.save();

// Get Clips
for (final List<ClipShape> clips in clipShapes) {
for (final ClipShape clipShape in clips) {
var shape = clipShape.shape;
if (shape.renderCollapsed) {
continue;
}
if (clipShape.intersect) {
canvas.clipPath((shape as FlutterActorShape).path);
} else {
var artboardRect = Rect.fromLTWH(
artboard.origin[0] * artboard.width,
artboard.origin[1] * artboard.height,
artboard.width,
artboard.height);

if (shape.fill != null && shape.fill.fillRule == FillRule.evenOdd) {
// One single clip path with subtraction rect and all sub paths.
var clipPath = ui.Path();
clipPath.addRect(artboardRect);
for (final path in shape.paths) {
clipPath.addPath((path as FlutterPath).path, ui.Offset.zero,
matrix4: path.pathTransform?.mat4);
}
clipPath.fillType = PathFillType.evenOdd;
canvas.clipPath(clipPath);
} else {
// One clip path with rect per shape path.
for (final path in shape.paths) {
var clipPath = ui.Path();
clipPath.addRect(artboardRect);
clipPath.addPath((path as FlutterPath).path, ui.Offset.zero,
matrix4: path.pathTransform?.mat4);
clipPath.fillType = PathFillType.evenOdd;
canvas.clipPath(clipPath);
}
}
}
}
}
clip(canvas);

ui.Path renderPath = getRenderPath(canvas);

Expand Down Expand Up @@ -1129,19 +1135,8 @@ class FlutterActorImage extends ActorImage with FlutterActorDrawable {
return;
}
canvas.save();
// Get Clips
for (final List<ClipShape> clips in clipShapes) {
if (clips.length == 1) {
canvas.clipPath((clips[0] as FlutterActorShape).path);
} else {
ui.Path clippingPath = ui.Path();
for (final ClipShape clipShape in clips) {
clippingPath.addPath(
(clipShape.shape as FlutterActorShape).path, ui.Offset.zero);
}
canvas.clipPath(clippingPath);
}
}

clip(canvas);

_paint.color =
_paint.color.withOpacity(renderOpacity.clamp(0.0, 1.0).toDouble());
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.6.0
version: 1.6.1
author: "2Dimensions Team <[email protected]>"
homepage: https://github.com/2d-inc/Flare-Flutter
environment:
Expand Down

0 comments on commit f695594

Please sign in to comment.