diff --git a/spine-flutter/example/lib/main.dart b/spine-flutter/example/lib/main.dart index 302b4f8e3..2c1b36555 100644 --- a/spine-flutter/example/lib/main.dart +++ b/spine-flutter/example/lib/main.dart @@ -55,7 +55,7 @@ class SimpleAnimation extends StatelessWidget { return Scaffold( appBar: AppBar(title: const Text('Spineboy')), - body: SpineWidget.asset("assets/skeleton.json", "assets/skeleton.atlas", controller, alignment: Alignment.centerLeft, fit: BoxFit.none), + body: SpineWidget.asset("assets/skeleton.json", "assets/skeleton.atlas", controller, alignment: Alignment.topLeft, fit: BoxFit.cover), // body: SpineWidget.asset("assets/spineboy-pro.skel", "assets/spineboy.atlas", controller, alignment: Alignment.bottomLeft) // body: SpineWidget.file("/Users/badlogic/workspaces/spine-runtimes/examples/spineboy/export/spineboy-pro.skel", "/Users/badlogic/workspaces/spine-runtimes/examples/spineboy/export/spineboy.atlas", controller), // body: const SpineWidget.http("https://marioslab.io/dump/spineboy/spineboy-pro.json", "https://marioslab.io/dump/spineboy/spineboy.atlas"), diff --git a/spine-flutter/lib/spine_widget.dart b/spine-flutter/lib/spine_widget.dart index 87e995b49..f453042cd 100644 --- a/spine-flutter/lib/spine_widget.dart +++ b/spine-flutter/lib/spine_widget.dart @@ -345,7 +345,7 @@ class _SpineRenderObject extends RenderBox { void _setCanvasTransform(Canvas canvas, Offset offset) { final double x = -_bounds.x - _bounds.width / 2.0 - (_alignment.x * _bounds.width / 2.0); - final double y = -_bounds.y - _bounds.height / 2.0 + (_alignment.y * _bounds.height / 2.0); + final double y = -_bounds.y - _bounds.height / 2.0 - (_alignment.y * _bounds.height / 2.0); double scaleX = 1.0, scaleY = 1.0; switch (_fit) {