fix: Widgets flickering (#3343)

Fix the flickering in the widgets: `SpriteAnimationWidget`,
`SpriteWidget` and `NineTileBoxWidget`.
This commit is contained in:
Erick
2024-10-16 12:11:17 -03:00
committed by GitHub
parent 7311d034d4
commit ff170dc5c2
10 changed files with 664 additions and 36 deletions

View File

@ -12,8 +12,14 @@ Widget partialSpriteWidgetBuilder(DashbookContext ctx) {
decoration: BoxDecoration(border: Border.all(color: Colors.amber)),
child: SpriteWidget.asset(
path: 'bomb_ptero.png',
srcPosition: Vector2(48, 0),
srcSize: Vector2(48, 32),
srcPosition: Vector2(
ctx.numberProperty('srcPosition.x', 48),
ctx.numberProperty('srcPosition.y', 0),
),
srcSize: Vector2(
ctx.numberProperty('srcSize.x', 48),
ctx.numberProperty('srcSize.y', 32),
),
anchor: Anchor.valueOf(
ctx.listProperty('anchor', 'center', anchorOptions),
),