Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Adding scale parameter to RectangleComponent constructors #2730

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/flame/lib/src/geometry/circle_component.dart
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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