mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
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:
@ -14,6 +14,7 @@ class CircleComponent extends ShapeComponent implements SizeProvider {
|
||||
CircleComponent({
|
||||
double? radius,
|
||||
super.position,
|
||||
super.scale,
|
||||
super.angle,
|
||||
super.anchor,
|
||||
super.children,
|
||||
@ -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,
|
||||
|
||||
@ -8,6 +8,7 @@ class RectangleComponent extends PolygonComponent {
|
||||
RectangleComponent({
|
||||
super.position,
|
||||
super.size,
|
||||
super.scale,
|
||||
super.angle,
|
||||
super.anchor,
|
||||
super.children,
|
||||
@ -27,6 +28,7 @@ class RectangleComponent extends PolygonComponent {
|
||||
RectangleComponent.square({
|
||||
double size = 0,
|
||||
super.position,
|
||||
super.scale,
|
||||
super.angle,
|
||||
super.anchor,
|
||||
super.priority,
|
||||
@ -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,
|
||||
@ -92,6 +95,7 @@ class RectangleComponent extends PolygonComponent {
|
||||
rect.size.toVector2(),
|
||||
),
|
||||
size: rect.size.toVector2(),
|
||||
scale: scale,
|
||||
angle: angle,
|
||||
anchor: anchor,
|
||||
priority: priority,
|
||||
|
||||
Reference in New Issue
Block a user