Skip to content

Commit

Permalink
Fix event target not being set to the tiles renderer (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson authored Dec 20, 2024
1 parent 8a0b886 commit 13121a0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/three/TilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export class TilesRenderer extends TilesRendererBase {
this.activeTiles = new Set();
this.visibleTiles = new Set();
this.optimizeRaycast = true;
this._eventDispatcher = new EventDispatcher();
this._upRotationMatrix = new Matrix4();

this.lruCache.computeMemoryUsageCallback = tile => tile.cached.bytesUsed ?? null;
Expand All @@ -106,6 +105,9 @@ export class TilesRenderer extends TilesRendererBase {
} );
this.manager = manager;

// saved for event dispatcher functions
this._listeners = {};

if ( REVISION_LESS_165 ) {

// Setting up the override raycasting function to be used by
Expand All @@ -127,25 +129,25 @@ export class TilesRenderer extends TilesRendererBase {

addEventListener( ...args ) {

this._eventDispatcher.addEventListener( ...args );
EventDispatcher.prototype.addEventListener.call( this, ...args );

}

hasEventListener( ...args ) {

this._eventDispatcher.hasEventListener( ...args );
EventDispatcher.prototype.hasEventListener.call( this, ...args );

}

removeEventListener( ...args ) {

this._eventDispatcher.removeEventListener( ...args );
EventDispatcher.prototype.removeEventListener.call( this, ...args );

}

dispatchEvent( ...args ) {

this._eventDispatcher.dispatchEvent( ...args );
EventDispatcher.prototype.dispatchEvent.call( this, ...args );

}

Expand Down

0 comments on commit 13121a0

Please sign in to comment.