Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event target not being set to the tiles renderer #881

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading