Skip to content

Commit 447923a

Browse files
committed
fence bounds
1 parent 04962f5 commit 447923a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/RenderWebGL.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const log = require('./util/log');
1616

1717
const __isTouchingDrawablesPoint = twgl.v3.create();
1818
const __candidatesBounds = new Rectangle();
19+
const __fenceBounds = new Rectangle();
1920
const __touchingColor = new Uint8ClampedArray(4);
2021
const __blendColor = new Uint8ClampedArray(4);
2122

@@ -1357,7 +1358,7 @@ class RenderWebGL extends EventEmitter {
13571358

13581359
const dx = x - drawable._position[0];
13591360
const dy = y - drawable._position[1];
1360-
const aabb = drawable._skin.getFenceBounds(drawable);
1361+
const aabb = drawable._skin.getFenceBounds(drawable, __fenceBounds);
13611362
const inset = Math.floor(Math.min(aabb.width, aabb.height) / 2);
13621363

13631364
const sx = this._xRight - Math.min(FENCE_WIDTH, inset);
@@ -1627,14 +1628,14 @@ class RenderWebGL extends EventEmitter {
16271628
}
16281629

16291630
twgl.setUniforms(currentShader, uniforms);
1630-
1631+
16311632
/* adjust blend function for this skin */
16321633
if (drawable.skin.hasPremultipliedAlpha){
16331634
gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
16341635
} else {
16351636
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
16361637
}
1637-
1638+
16381639
twgl.drawBufferInfo(gl, this._bufferInfo, gl.TRIANGLES);
16391640
}
16401641

0 commit comments

Comments
 (0)