mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[flutter] Fix y-offset calculation in layouting.
This commit is contained in:
parent
86f68ecf04
commit
e526619e96
@ -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"),
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user