File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Sources/Widgets/Core/WidgetManager Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,17 @@ function vtkWidgetManager(publicAPI, model) {
183
183
}
184
184
}
185
185
186
+ const deactivateAllWidgets = ( ) => {
187
+ let wantRender = false ;
188
+ for ( let i = 0 ; i < model . widgets . length ; i ++ ) {
189
+ const w = model . widgets [ i ] ;
190
+ wantRender ||= ! ! w . getActiveState ( ) ;
191
+ w . deactivateAllHandles ( ) ;
192
+ }
193
+
194
+ if ( wantRender ) model . _interactor . render ( ) ;
195
+ } ;
196
+
186
197
const handleEvent = async ( callData , fromTouchEvent = false ) => {
187
198
if (
188
199
! model . isAnimating &&
@@ -192,6 +203,8 @@ function vtkWidgetManager(publicAPI, model) {
192
203
const callID = Symbol ( 'UpdateSelection' ) ;
193
204
model . _currentUpdateSelectionCallID = callID ;
194
205
await updateSelection ( callData , fromTouchEvent , callID ) ;
206
+ } else {
207
+ deactivateAllWidgets ( ) ;
195
208
}
196
209
} ;
197
210
You can’t perform that action at this time.
0 commit comments