Skip to content

Commit

Permalink
Make _calculateRotationCenter private...
Browse files Browse the repository at this point in the history
and just return nativeRotationCenter in getSkinRotationCenter to do so.
  • Loading branch information
adroitwhiz committed Mar 4, 2021
1 parent 1a32333 commit 9cb355c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/BitmapSkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion src/RenderWebGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ class RenderWebGL extends EventEmitter {
*/
getSkinRotationCenter (skinID) {
const skin = this._allSkins[skinID];
return skin.calculateRotationCenter();
return skin.nativeRotationCenter;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/SVGSkin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion src/Skin.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Skin extends EventEmitter {
* Get the center of the current bounding box
* @return {Array<number>} the center of the current bounding box
*/
calculateRotationCenter () {
_calculateRotationCenter () {
return [this.nativeSize[0] / 2, this.nativeSize[1] / 2];
}

Expand Down

0 comments on commit 9cb355c

Please sign in to comment.