Skip to content

Commit c870373

Browse files
Fix BitmapLayer crash during multi-depth picking (visgl#5640)
1 parent 65a535c commit c870373

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

modules/layers/src/bitmap-layer/bitmap-layer.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ export default class BitmapLayer extends Layer {
133133
return info;
134134
}
135135

136+
// Override base Layer multi-depth picking logic
137+
disablePickingIndex() {
138+
this.setState({disablePicking: true});
139+
}
140+
141+
restorePickingColors() {
142+
this.setState({disablePicking: false});
143+
}
144+
136145
_updateAutoHighlight(info) {
137146
super._updateAutoHighlight({
138147
...info,
@@ -186,10 +195,14 @@ export default class BitmapLayer extends Layer {
186195
}
187196

188197
draw(opts) {
189-
const {uniforms} = opts;
190-
const {model, coordinateConversion, bounds} = this.state;
198+
const {uniforms, moduleParameters} = opts;
199+
const {model, coordinateConversion, bounds, disablePicking} = this.state;
191200
const {image, desaturate, transparentColor, tintColor} = this.props;
192201

202+
if (moduleParameters.pickingActive && disablePicking) {
203+
return;
204+
}
205+
193206
// // TODO fix zFighting
194207
// Render the image
195208
if (image && model) {

0 commit comments

Comments
 (0)