Skip to content

Commit 9cb355c

Browse files
committed
Make _calculateRotationCenter private...
and just return nativeRotationCenter in getSkinRotationCenter to do so.
1 parent 1a32333 commit 9cb355c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/BitmapSkin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class BitmapSkin extends Skin {
9090
this._costumeResolution = costumeResolution || 2;
9191
this._textureSize = BitmapSkin._getBitmapSize(bitmapData);
9292

93-
if (typeof rotationCenter === 'undefined') rotationCenter = this.calculateRotationCenter();
93+
if (typeof rotationCenter === 'undefined') rotationCenter = this._calculateRotationCenter();
9494
this._nativeRotationCenter[0] = rotationCenter[0];
9595
this._nativeRotationCenter[1] = rotationCenter[1];
9696

src/RenderWebGL.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ class RenderWebGL extends EventEmitter {
753753
*/
754754
getSkinRotationCenter (skinID) {
755755
const skin = this._allSkins[skinID];
756-
return skin.calculateRotationCenter();
756+
return skin.nativeRotationCenter;
757757
}
758758

759759
/**

src/SVGSkin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class SVGSkin extends Skin {
300300
}
301301
this._nativeSize[0] = width;
302302
this._nativeSize[1] = height;
303-
if (typeof rotationCenter === 'undefined') rotationCenter = this.calculateRotationCenter();
303+
if (typeof rotationCenter === 'undefined') rotationCenter = this._calculateRotationCenter();
304304
this._nativeRotationCenter[0] = rotationCenter[0];
305305
this._nativeRotationCenter[1] = rotationCenter[1];
306306

src/Skin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Skin extends EventEmitter {
125125
* Get the center of the current bounding box
126126
* @return {Array<number>} the center of the current bounding box
127127
*/
128-
calculateRotationCenter () {
128+
_calculateRotationCenter () {
129129
return [this.nativeSize[0] / 2, this.nativeSize[1] / 2];
130130
}
131131

0 commit comments

Comments
 (0)