Skip to content

Commit

Permalink
fix: each icon set shows hover icon simultaneously (#3410)
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite authored Jun 23, 2023
1 parent e2ca933 commit 31d6f2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions viewer/packages/360-images/src/Image360Facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ export class Image360Facade<T> {
this._image360Collections.forEach(collection => collection.setSelectedForAll(visible));
}

set hoverIconVisibility(visible: boolean) {
this._image360Collections.forEach(collection => collection.setSelectedVisibility(visible));
setHoverIconVisibilityForEntity(entity: Image360Entity, visible: boolean): void {
this.getCollectionContainingEntity(entity).setSelectedVisibility(visible);
}

hideAllHoverIcons(): void {
this._image360Collections.forEach(collection => collection.setSelectedVisibility(false));
}

set allIconCullingScheme(scheme: IconCullingScheme) {
Expand Down
4 changes: 2 additions & 2 deletions viewer/packages/api/src/api-helpers/Image360ApiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,11 @@ export class Image360ApiHelper {
}

if (entity !== undefined) {
this._image360Facade.hoverIconVisibility = true;
this._image360Facade.setHoverIconVisibilityForEntity(entity, true);
entity.icon.selected = true;
this._debouncePreLoad(entity);
} else {
this._image360Facade.hoverIconVisibility = false;
this._image360Facade.hideAllHoverIcons();
}

this._needsRedraw = true;
Expand Down

0 comments on commit 31d6f2e

Please sign in to comment.