Skip to content

Commit 0ffcd87

Browse files
committed
fix: correct highlighter coloring with edited models
1 parent a6c4452 commit 0ffcd87

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

packages/front/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@thatopen/components-front",
33
"description": "Collection of frontend tools to author BIM apps.",
4-
"version": "3.2.2",
4+
"version": "3.2.3",
55
"author": "That Open Company",
66
"contributors": [
77
"Antonio Gonzalez Viegas (https://github.com/agviegas)",

packages/front/src/fragments/Highlighter/index.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,19 +297,6 @@ export class Highlighter
297297
OBC.ModelIdMapUtils.add(map, { [model.parentModelId]: ids });
298298
}
299299

300-
const selectables = this.selectable?.[name];
301-
if (selectables) {
302-
// Include the parent modelIds in the delta modelIdMap from selectables
303-
const selectable = OBC.ModelIdMapUtils.clone(selectables);
304-
for (const [modelId, ids] of Object.entries(selectable)) {
305-
const model = fragments.list.get(modelId);
306-
if (!model?.deltaModelId) continue;
307-
OBC.ModelIdMapUtils.add(selectable, { [model.deltaModelId]: ids });
308-
}
309-
310-
map = OBC.ModelIdMapUtils.intersect([map, selectable]);
311-
}
312-
313300
if (exclude) {
314301
// Include the parent modelIds in the exclusion modelIdMap from exclude
315302
const exclusion = OBC.ModelIdMapUtils.clone(exclude);
@@ -381,6 +368,14 @@ export class Highlighter
381368
? modelIdMap
382369
: this.getMapWithoutSelection(style);
383370
if (!map) continue;
371+
372+
// Add delta models to model id map
373+
for (const [modelId, ids] of Object.entries(map)) {
374+
const model = fragments.list.get(modelId);
375+
if (!model?.deltaModelId) continue;
376+
OBC.ModelIdMapUtils.add(map, { [model.deltaModelId]: ids });
377+
}
378+
384379
promises.push(
385380
fragments.highlight({ ...definition, customId: style }, map),
386381
);

0 commit comments

Comments
 (0)