@@ -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