Skip to content

Commit

Permalink
Fix race condition for tiles rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jul 6, 2024
1 parent 6bcfa61 commit aa399a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions example/src/plugins/overlays/TextureOverlayMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const TextureOverlayMaterialMixin = base => class extends base {
DISPLAY_AS_OVERLAY: Number( this.displayAsOverlay ),
};

console.log('UPDATE')

// WebGL does not seem to like empty texture arrays
if ( textures.length !== 0 ) {

Expand Down
4 changes: 2 additions & 2 deletions example/src/plugins/overlays/TextureOverlayPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function canUseImageBitmap() {

}


return ! ( typeof createImageBitmap === 'undefined' || isSafari || ( isFirefox && firefoxVersion < 98 ) );

}
Expand Down Expand Up @@ -218,7 +217,8 @@ export class TextureOverlayPlugin {

this._assignTexturesCallback = ( { tile, scene } ) => {

this.assignCallback( scene, tile, this );
// queue a microtask here so we can make sure this fires after all the other load events
queueMicrotask( () => this.assignCallback( scene, tile, this ) );

};

Expand Down

0 comments on commit aa399a4

Please sign in to comment.