Skip to content

Commit b5059d1

Browse files
committed
Inline the last _getDrawableScreenSpaceScale call
1 parent 204413a commit b5059d1

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/RenderWebGL.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,18 +1664,6 @@ class RenderWebGL extends EventEmitter {
16641664
this._regionId = null;
16651665
}
16661666

1667-
/**
1668-
* Get the screen-space scale of a drawable, as percentages of the drawable's "normal" size.
1669-
* @param {Drawable} drawable The drawable whose screen-space scale we're fetching.
1670-
* @returns {Array<number>} The screen-space X and Y dimensions of the drawable's scale, as percentages.
1671-
*/
1672-
_getDrawableScreenSpaceScale (drawable) {
1673-
return [
1674-
drawable.scale[0] * this._gl.canvas.width / this._nativeSize[0],
1675-
drawable.scale[1] * this._gl.canvas.height / this._nativeSize[1]
1676-
];
1677-
}
1678-
16791667
/**
16801668
* Draw a set of Drawables, by drawable ID
16811669
* @param {Array<int>} drawables The Drawable IDs to draw, possibly this._drawList.
@@ -1708,7 +1696,10 @@ class RenderWebGL extends EventEmitter {
17081696
if (!drawable.getVisible() && !opts.ignoreVisibility) continue;
17091697

17101698
// Combine drawable scale with the native vs. backing pixel ratio
1711-
const drawableScale = this._getDrawableScreenSpaceScale(drawable);
1699+
const drawableScale = [
1700+
drawable.scale[0] * this._gl.canvas.width / this._nativeSize[0],
1701+
drawable.scale[1] * this._gl.canvas.height / this._nativeSize[1]
1702+
];
17121703

17131704
// If the skin or texture isn't ready yet, skip it.
17141705
if (!drawable.skin || !drawable.skin.getTexture(drawableScale)) continue;

0 commit comments

Comments
 (0)