Skip to content

Commit

Permalink
Merge pull request #115 from 2d-inc/master
Browse files Browse the repository at this point in the history
Instance shape node from actor.
  • Loading branch information
luigi-rosso committed Jul 3, 2019
2 parents 0ee2efe + 525613e commit 01387cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
16 changes: 7 additions & 9 deletions flare_dart/lib/actor_shape.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,27 @@ class ActorShape extends ActorDrawable {

static ActorShape read(
ActorArtboard artboard, StreamReader reader, ActorShape component) {
if (component == null) {
component = ActorShape();
}

ActorDrawable.read(artboard, reader, component);

return component;
}

@override
ActorComponent makeInstance(ActorArtboard resetArtboard) {
ActorShape instanceEvent = ActorShape();
instanceEvent.copyShape(this, resetArtboard);
return instanceEvent;
ActorShape instanceShape = resetArtboard.actor.makeShapeNode();
instanceShape.copyShape(this, resetArtboard);
return instanceShape;
}

void copyShape(ActorShape node, ActorArtboard resetArtboard) {
copyDrawable(node, resetArtboard);
}

@override
AABB computeAABB() {
AABB aabb;
for (List<ActorShape> clips in clipShapes) {
for (ActorShape node in clips) {
for (final List<ActorShape> clips in clipShapes) {
for (final ActorShape node in clips) {
AABB bounds = node.computeAABB();
if (bounds == null) {
continue;
Expand Down
7 changes: 0 additions & 7 deletions flare_flutter/lib/flare.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,6 @@ class FlutterActorShape extends ActorShape with FlutterActorDrawable {

canvas.restore();
}

@override
ActorComponent makeInstance(ActorArtboard resetArtboard) {
FlutterActorShape instanceNode = FlutterActorShape();
instanceNode.copyShape(this, resetArtboard);
return instanceNode;
}
}

class FlutterColorFill extends ColorFill with FlutterFill {
Expand Down

0 comments on commit 01387cd

Please sign in to comment.