Skip to content

Commit 0c9f5f2

Browse files
committed
Always base w/h on scale of 1
1 parent d1bad8a commit 0c9f5f2

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

plugins/spine/src/gameobject/SpineGameObject.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,13 @@ var SpineGameObject = new Class({
138138

139139
var height = renderer.height;
140140

141+
var oldScaleX = this.scaleX;
142+
var oldScaleY = this.scaleY;
143+
141144
skeleton.x = this.x;
142145
skeleton.y = height - this.y;
143-
skeleton.scaleX = this.scaleX;
144-
skeleton.scaleY = this.scaleY;
146+
skeleton.scaleX = 1;
147+
skeleton.scaleY = 1;
145148

146149
this.skeleton = skeleton;
147150

@@ -157,15 +160,17 @@ var SpineGameObject = new Class({
157160

158161
var b = this.getBounds();
159162

160-
var sx = 1 / this.scaleX;
161-
var sy = 1 / this.scaleY;
162-
163-
this.width = b.size.x * sx;
164-
this.height = b.size.y * sy;
163+
this.width = b.size.x;
164+
this.height = b.size.y;
165165

166-
this.displayOriginX = (this.x - b.offset.x) * sx;
166+
this.displayOriginX = this.x - b.offset.x;
167167
this.displayOriginY = this.y - (height - (this.height + b.offset.y));
168168

169+
skeleton.scaleX = oldScaleX;
170+
skeleton.scaleY = oldScaleY;
171+
172+
skeleton.updateWorldTransform();
173+
169174
return this;
170175
},
171176

0 commit comments

Comments
 (0)