Skip to content

Commit df24616

Browse files
committed
Don't include text bubbles in touching queries
1 parent 969fd7a commit df24616

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/RenderWebGL.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,11 @@ class RenderWebGL extends EventEmitter {
859859
gl.colorMask(true, true, true, true);
860860

861861
this._drawThese(candidateIDs, ShaderManager.DRAW_MODE.default, projection,
862-
{idFilterFunc: testID => testID !== drawableID}
862+
{idFilterFunc: testID =>
863+
testID !== drawableID &&
864+
// Text bubbles aren't considered in "touching" queries
865+
!(this._allDrawables[testID].skin instanceof TextBubbleSkin)
866+
}
863867
);
864868
} finally {
865869
gl.colorMask(true, true, true, true);
@@ -1293,6 +1297,8 @@ class RenderWebGL extends EventEmitter {
12931297
const id = candidateIDs[index];
12941298
if (id !== drawableID) {
12951299
const drawable = this._allDrawables[id];
1300+
// Text bubbles aren't considered in "touching" queries
1301+
if (drawable.skin instanceof TextBubbleSkin) continue;
12961302
if (drawable.skin && drawable._visible) {
12971303
// Update the CPU position data
12981304
drawable.updateMatrix();

src/TextBubbleSkin.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ class TextBubbleSkin extends Skin {
241241
this._renderedScale = scale;
242242
}
243243

244+
updateSilhouette (scale = [100, 100]) {
245+
// Ensure a silhouette exists.
246+
this.getTexture(scale);
247+
}
248+
244249
/**
245250
* @param {Array<number>} scale - The scaling factors to be used, each in the [0,100] range.
246251
* @return {WebGLTexture} The GL texture representation of this skin when drawing at the given scale.

0 commit comments

Comments
 (0)