[flutter] More dress-up changes.

This commit is contained in:
Mario Zechner 2022-11-17 19:14:15 +01:00
parent a66218cb14
commit 11add2a56d

View File

@ -30,7 +30,6 @@ class DressUpState extends State<DressUp> {
skeleton.updateWorldTransform();
var bounds = skeleton.getBounds();
var scale = 1 / (bounds.width > bounds.height ? bounds.width / thumbnailSize : bounds.height / thumbnailSize);
scale *= 0.9;
var recorder = ui.PictureRecorder();
var canvas = Canvas(recorder);
@ -40,7 +39,7 @@ class DressUpState extends State<DressUp> {
..style = PaintingStyle.fill;
canvas.drawRect(const Rect.fromLTWH(0, 0, thumbnailSize, thumbnailSize), paint);
canvas.scale(scale, scale);
canvas.translate(-bounds.x, -bounds.y);
canvas.translate(-bounds.x + bounds.width / 2, -bounds.y);
canvas.drawRect(Rect.fromLTRB(-5, -5, 5, -5), paint..color = Colors.red);
drawable.renderToCanvas(canvas);