Skip to content

Commit

Permalink
Clip artboard rect
Browse files Browse the repository at this point in the history
  • Loading branch information
umberto-sonnino committed Aug 26, 2019
1 parent 894a97c commit a0b1bdb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flare_flutter/lib/flare.dart
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,19 @@ class FlutterActorArtboard extends ActorArtboard {
FlutterActorArtboard(FlutterActor actor) : super(actor);

void draw(ui.Canvas canvas) {
if(clipContents) {
canvas.save();
AABB aabb = artboardAABB();
canvas.clipRect(Rect.fromLTRB(aabb[0], aabb[1], aabb[2], aabb[3]));
}
for (final ActorDrawable drawable in drawableNodes) {
if (drawable is FlutterActorDrawable) {
(drawable as FlutterActorDrawable).draw(canvas);
}
}
if(clipContents) {
canvas.restore();
}
}

void dispose() {}
Expand Down

0 comments on commit a0b1bdb

Please sign in to comment.