diff --git a/src/BitmapSkin.js b/src/BitmapSkin.js index 000ecf99e..4b87a0f44 100644 --- a/src/BitmapSkin.js +++ b/src/BitmapSkin.js @@ -90,7 +90,7 @@ class BitmapSkin extends Skin { this._costumeResolution = costumeResolution || 2; this._textureSize = BitmapSkin._getBitmapSize(bitmapData); - if (typeof rotationCenter === 'undefined') rotationCenter = this.calculateRotationCenter(); + if (typeof rotationCenter === 'undefined') rotationCenter = this._calculateRotationCenter(); this._nativeRotationCenter[0] = rotationCenter[0]; this._nativeRotationCenter[1] = rotationCenter[1]; diff --git a/src/RenderWebGL.js b/src/RenderWebGL.js index 289ff1508..89d24ebe5 100644 --- a/src/RenderWebGL.js +++ b/src/RenderWebGL.js @@ -753,7 +753,7 @@ class RenderWebGL extends EventEmitter { */ getSkinRotationCenter (skinID) { const skin = this._allSkins[skinID]; - return skin.calculateRotationCenter(); + return skin.nativeRotationCenter; } /** diff --git a/src/SVGSkin.js b/src/SVGSkin.js index 5a3ba3a7c..c83d5412d 100644 --- a/src/SVGSkin.js +++ b/src/SVGSkin.js @@ -300,7 +300,7 @@ class SVGSkin extends Skin { } this._nativeSize[0] = width; this._nativeSize[1] = height; - if (typeof rotationCenter === 'undefined') rotationCenter = this.calculateRotationCenter(); + if (typeof rotationCenter === 'undefined') rotationCenter = this._calculateRotationCenter(); this._nativeRotationCenter[0] = rotationCenter[0]; this._nativeRotationCenter[1] = rotationCenter[1]; diff --git a/src/Skin.js b/src/Skin.js index 9ab992fe7..aecd9dd70 100644 --- a/src/Skin.js +++ b/src/Skin.js @@ -125,7 +125,7 @@ class Skin extends EventEmitter { * Get the center of the current bounding box * @return {Array} the center of the current bounding box */ - calculateRotationCenter () { + _calculateRotationCenter () { return [this.nativeSize[0] / 2, this.nativeSize[1] / 2]; }