Skip to content

Commit

Permalink
feat: Adding children argument to all constructors in the shape compo…
Browse files Browse the repository at this point in the history
…nents (#2862)

Some constructors in the shape components were missing, this PR adds
them.
  • Loading branch information
erickzanardo committed Nov 22, 2023
1 parent 208d789 commit 082743d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/flame/lib/src/geometry/circle_component.dart
Expand Up @@ -35,6 +35,7 @@ class CircleComponent extends ShapeComponent implements SizeProvider {
super.anchor,
super.paint,
super.paintLayers,
super.children,
}) : super(size: Vector2.all(relation * min(parentSize.x, parentSize.y)));

@override
Expand Down
2 changes: 2 additions & 0 deletions packages/flame/lib/src/geometry/polygon_component.dart
Expand Up @@ -80,6 +80,7 @@ class PolygonComponent extends ShapeComponent {
List<Paint>? paintLayers,
bool? shrinkToBounds,
ComponentKey? key,
List<Component>? children,
}) : this(
normalsToVertices(relation, parentSize),
position: position,
Expand All @@ -91,6 +92,7 @@ class PolygonComponent extends ShapeComponent {
paintLayers: paintLayers,
shrinkToBounds: shrinkToBounds,
key: key,
children: children,
);

@internal
Expand Down
3 changes: 3 additions & 0 deletions packages/flame/lib/src/geometry/rectangle_component.dart
Expand Up @@ -61,6 +61,7 @@ class RectangleComponent extends PolygonComponent {
super.paintLayers,
super.shrinkToBounds,
super.key,
super.children,
}) : super.relative([
relation.clone(),
Vector2(relation.x, -relation.y),
Expand All @@ -85,6 +86,7 @@ class RectangleComponent extends PolygonComponent {
Paint? paint,
List<Paint>? paintLayers,
ComponentKey? key,
List<Component>? children,
}) {
return RectangleComponent(
position: anchor == Anchor.topLeft
Expand All @@ -102,6 +104,7 @@ class RectangleComponent extends PolygonComponent {
paint: paint,
paintLayers: paintLayers,
key: key,
children: children,
);
}

Expand Down

0 comments on commit 082743d

Please sign in to comment.