Skip to content

Commit

Permalink
fix: Adding scale parameter to RectangleComponent constructors (#2730)
Browse files Browse the repository at this point in the history
While working with RectangleComponent I noticed that it doesn't expose
its super `scale` parameter, this PR changes that.
  • Loading branch information
erickzanardo committed Sep 12, 2023
1 parent c1ee24a commit 173908d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/flame/lib/src/geometry/circle_component.dart
Expand Up @@ -14,6 +14,7 @@ class CircleComponent extends ShapeComponent implements SizeProvider {
CircleComponent({
double? radius,
super.position,
super.scale,
super.angle,
super.anchor,
super.children,
Expand All @@ -29,6 +30,7 @@ class CircleComponent extends ShapeComponent implements SizeProvider {
double relation, {
required Vector2 parentSize,
super.position,
super.scale,
super.angle,
super.anchor,
super.paint,
Expand Down
4 changes: 4 additions & 0 deletions packages/flame/lib/src/geometry/rectangle_component.dart
Expand Up @@ -8,6 +8,7 @@ class RectangleComponent extends PolygonComponent {
RectangleComponent({
super.position,
super.size,
super.scale,
super.angle,
super.anchor,
super.children,
Expand All @@ -27,6 +28,7 @@ class RectangleComponent extends PolygonComponent {
RectangleComponent.square({
double size = 0,
super.position,
super.scale,
super.angle,
super.anchor,
super.priority,
Expand Down Expand Up @@ -76,6 +78,7 @@ class RectangleComponent extends PolygonComponent {
/// This factory will create a [RectangleComponent] from a positioned [Rect].
factory RectangleComponent.fromRect(
Rect rect, {
Vector2? scale,
double? angle,
Anchor anchor = Anchor.topLeft,
int? priority,
Expand All @@ -92,6 +95,7 @@ class RectangleComponent extends PolygonComponent {
rect.size.toVector2(),
),
size: rect.size.toVector2(),
scale: scale,
angle: angle,
anchor: anchor,
priority: priority,
Expand Down

0 comments on commit 173908d

Please sign in to comment.