@@ -797,7 +797,7 @@ export class MainView extends React.Component<IProps, IStates> {
797
797
this . _scene . remove ( this . _clippingPlaneMesh ) ;
798
798
}
799
799
800
- const selectedNames = this . _selectedMeshes . map ( sel => sel . name ) ;
800
+ const selectedNames = Object . keys ( this . _currentSelection || { } ) ;
801
801
this . _selectedMeshes = [ ] ;
802
802
803
803
this . _boundingGroup = new THREE . Box3 ( ) ;
@@ -896,10 +896,10 @@ export class MainView extends React.Component<IProps, IStates> {
896
896
} ) ;
897
897
this . _meshGroup ?. add ( meshGroup ) ;
898
898
}
899
-
900
- this . _updateTransformControls ( selectedNames ) ;
901
899
} ) ;
902
900
901
+ this . _updateTransformControls ( selectedNames ) ;
902
+
903
903
// Update the reflength.
904
904
this . _updateRefLength ( this . _refLength === null ) ;
905
905
// Set the expoded view if it's enabled
@@ -1137,12 +1137,13 @@ export class MainView extends React.Component<IProps, IStates> {
1137
1137
1138
1138
private _updateSelected ( selection : { [ key : string ] : ISelection } ) {
1139
1139
const selectionChanged =
1140
- JSON . stringify ( selection ) !== JSON . stringify ( this . _previousSelection ) ;
1140
+ JSON . stringify ( selection ) !== JSON . stringify ( this . _currentSelection ) ;
1141
1141
1142
1142
if ( ! selectionChanged ) {
1143
1143
return ;
1144
1144
}
1145
- this . _previousSelection = { ...selection } ;
1145
+ this . _currentSelection = { ...selection } ;
1146
+ const selectedNames = Object . keys ( selection ) ;
1146
1147
1147
1148
// Reset original color and remove bounding boxes for old selection
1148
1149
for ( const selectedMesh of this . _selectedMeshes ) {
@@ -1182,7 +1183,6 @@ export class MainView extends React.Component<IProps, IStates> {
1182
1183
1183
1184
// Set new selection
1184
1185
this . _selectedMeshes = [ ] ;
1185
- const selectedNames = Object . keys ( selection ) ;
1186
1186
1187
1187
for ( const selectionName of selectedNames ) {
1188
1188
const selectedMesh = this . _meshGroup ?. getObjectByName (
@@ -1806,7 +1806,7 @@ export class MainView extends React.Component<IProps, IStates> {
1806
1806
private _clippingPlanes = [ this . _clippingPlane ] ;
1807
1807
private _edgeMaterials : any [ ] = [ ] ;
1808
1808
1809
- private _previousSelection : { [ key : string ] : ISelection } | null = null ;
1809
+ private _currentSelection : { [ key : string ] : ISelection } | null = null ;
1810
1810
1811
1811
private _scene : THREE . Scene ; // Threejs scene
1812
1812
private _camera : THREE . PerspectiveCamera | THREE . OrthographicCamera ; // Threejs camera
0 commit comments