fix: Adding scale parameter to RectangleComponent constructors (#2730)

While working with RectangleComponent I noticed that it doesn't expose
its super `scale` parameter, this PR changes that.
This commit is contained in:
Erick
2023-09-12 18:17:05 -03:00
committed by GitHub
parent c1ee24a289
commit 173908d9f2
2 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ class CircleComponent extends ShapeComponent implements SizeProvider {
CircleComponent({ CircleComponent({
double? radius, double? radius,
super.position, super.position,
super.scale,
super.angle, super.angle,
super.anchor, super.anchor,
super.children, super.children,
@ -29,6 +30,7 @@ class CircleComponent extends ShapeComponent implements SizeProvider {
double relation, { double relation, {
required Vector2 parentSize, required Vector2 parentSize,
super.position, super.position,
super.scale,
super.angle, super.angle,
super.anchor, super.anchor,
super.paint, super.paint,

View File

@ -8,6 +8,7 @@ class RectangleComponent extends PolygonComponent {
RectangleComponent({ RectangleComponent({
super.position, super.position,
super.size, super.size,
super.scale,
super.angle, super.angle,
super.anchor, super.anchor,
super.children, super.children,
@ -27,6 +28,7 @@ class RectangleComponent extends PolygonComponent {
RectangleComponent.square({ RectangleComponent.square({
double size = 0, double size = 0,
super.position, super.position,
super.scale,
super.angle, super.angle,
super.anchor, super.anchor,
super.priority, super.priority,
@ -76,6 +78,7 @@ class RectangleComponent extends PolygonComponent {
/// This factory will create a [RectangleComponent] from a positioned [Rect]. /// This factory will create a [RectangleComponent] from a positioned [Rect].
factory RectangleComponent.fromRect( factory RectangleComponent.fromRect(
Rect rect, { Rect rect, {
Vector2? scale,
double? angle, double? angle,
Anchor anchor = Anchor.topLeft, Anchor anchor = Anchor.topLeft,
int? priority, int? priority,
@ -92,6 +95,7 @@ class RectangleComponent extends PolygonComponent {
rect.size.toVector2(), rect.size.toVector2(),
), ),
size: rect.size.toVector2(), size: rect.size.toVector2(),
scale: scale,
angle: angle, angle: angle,
anchor: anchor, anchor: anchor,
priority: priority, priority: priority,