Always base w/h on scale of 1

This commit is contained in:
Richard Davey 2019-07-22 13:18:13 +01:00
parent d1bad8a1c1
commit 0c9f5f26a3

View file

@ -138,10 +138,13 @@ var SpineGameObject = new Class({
var height = renderer.height;
var oldScaleX = this.scaleX;
var oldScaleY = this.scaleY;
skeleton.x = this.x;
skeleton.y = height - this.y;
skeleton.scaleX = this.scaleX;
skeleton.scaleY = this.scaleY;
skeleton.scaleX = 1;
skeleton.scaleY = 1;
this.skeleton = skeleton;
@ -157,15 +160,17 @@ var SpineGameObject = new Class({
var b = this.getBounds();
var sx = 1 / this.scaleX;
var sy = 1 / this.scaleY;
this.width = b.size.x;
this.height = b.size.y;
this.width = b.size.x * sx;
this.height = b.size.y * sy;
this.displayOriginX = (this.x - b.offset.x) * sx;
this.displayOriginX = this.x - b.offset.x;
this.displayOriginY = this.y - (height - (this.height + b.offset.y));
skeleton.scaleX = oldScaleX;
skeleton.scaleY = oldScaleY;
skeleton.updateWorldTransform();
return this;
},