Skip to content

Commit

Permalink
fix(front): more fixes to highlight logic
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Oct 24, 2024
1 parent 27e4bc2 commit f5694d1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"access": "public"
},
"devDependencies": {
"@thatopen/fragments": ">=2.4.0-alpha.4",
"@thatopen/fragments": ">=2.4.0-alpha.8",
"@thatopen/ui": "~2.3.0",
"@types/three": "0.160.0",
"stats.js": "^0.17.0",
Expand All @@ -51,7 +51,7 @@
"three-mesh-bvh": "0.7.0"
},
"peerDependencies": {
"@thatopen/fragments": ">=2.4.0-alpha.4",
"@thatopen/fragments": ">=2.4.0-alpha.8",
"three": "^0.160.1",
"web-ifc": "0.0.61"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ifc/IfcJsonExporter/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ To convert IFC to JSON we need 2 things: `web-ifc` an the JSON exporter. The for
const exporter = components.get(OBC.IfcJsonExporter);

const webIfc = new WEBIFC.IfcAPI();
webIfc.SetWasmPath("https://unpkg.com/[email protected].57/", true);
webIfc.SetWasmPath("https://unpkg.com/[email protected].61/", true);
await webIfc.Init();

/* MD
Expand Down
6 changes: 3 additions & 3 deletions packages/front/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components-front",
"description": "Collection of frontend tools to author BIM apps.",
"version": "2.4.0-alpha.11",
"version": "2.4.0-alpha.12",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down Expand Up @@ -33,12 +33,12 @@
"publish-alpha": "npm publish --tag alpha"
},
"peerDependencies": {
"@thatopen/fragments": ">=2.4.0-alpha.4",
"@thatopen/fragments": ">=2.4.0-alpha.8",
"three": "^0.160.1",
"web-ifc": "0.0.61"
},
"devDependencies": {
"@thatopen/fragments": ">=2.4.0-alpha.4",
"@thatopen/fragments": ">=2.4.0-alpha.8",
"@thatopen/ui": "~2.3.0",
"@thatopen/ui-obc": "~2.3.0",
"@types/earcut": "^2.1.4",
Expand Down
14 changes: 8 additions & 6 deletions packages/front/src/fragments/Highlighter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,20 @@ export class Highlighter
clear(name?: string, filter?: FRAGS.FragmentIdMap) {
const names = name ? [name] : Object.keys(this.selection);

for (const name of names) {
this._fills.clear(name);
for (const selectionName of names) {
this._fills.clear(selectionName);

const fragments = this.components.get(OBC.FragmentsManager);

const selected = this.selection[name];
const selected = this.selection[selectionName];

for (const fragID in selected) {
const fragment = fragments.list.get(fragID);
if (!fragment) {
continue;
}

const idsToClear = selected[fragID];
let idsToClear = selected[fragID];
if (!idsToClear) {
continue;
}
Expand All @@ -486,6 +486,8 @@ export class Highlighter
remaining.add(id);
}
}

idsToClear = toClear;
if (remaining.size) {
selected[fragID] = remaining;
} else {
Expand All @@ -501,10 +503,10 @@ export class Highlighter
}

if (!filter) {
this.selection[name] = {};
this.selection[selectionName] = {};
}

this.events[name].onClear.trigger(null);
this.events[selectionName].onClear.trigger(null);
}
}

Expand Down

0 comments on commit f5694d1

Please sign in to comment.