Enable user-defined Anchors (#675)

* Enable user-defined Anchors

* Fix formatting

* get toVector2 -> toVector2()
This commit is contained in:
Lukas Klingsbo
2021-02-22 22:09:41 +01:00
committed by GitHub
parent 3078a7a4fd
commit 4e5b75eafb
6 changed files with 45 additions and 25 deletions

View File

@@ -69,7 +69,7 @@ class Sprite {
final drawPosition = position ?? Vector2.zero();
final drawSize = size ?? srcSize;
final delta = anchor.toVector2..multiply(drawSize);
final delta = anchor.toVector2()..multiply(drawSize);
final drawRect = (drawPosition + delta).toPositionedRect(drawSize);
final drawPaint = overridePaint ?? paint;