From 11add2a56d94142608f86f11413ad6e6b01a2c1a Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Thu, 17 Nov 2022 19:14:15 +0100 Subject: [PATCH] [flutter] More dress-up changes. --- spine-flutter/example/lib/dress_up.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spine-flutter/example/lib/dress_up.dart b/spine-flutter/example/lib/dress_up.dart index fc0c51ee4..0efdb2b57 100644 --- a/spine-flutter/example/lib/dress_up.dart +++ b/spine-flutter/example/lib/dress_up.dart @@ -30,7 +30,6 @@ class DressUpState extends State { 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 { ..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);