@@ -283,23 +283,25 @@ function vtkWidgetManager(publicAPI, model) {
283
283
// Default cursor behavior
284
284
model . _apiSpecificRenderWindow . setCursor ( widget ? 'pointer' : 'default' ) ;
285
285
286
+ let wantRender = false ;
286
287
if ( model . widgetInFocus === widget && widget . hasFocus ( ) ) {
287
288
activateHandle ( widget ) ;
288
- // Ken FIXME
289
- model . _interactor . render ( ) ;
290
- model . _interactor . render ( ) ;
289
+ wantRender = true ;
291
290
} else {
292
291
for ( let i = 0 ; i < model . widgets . length ; i ++ ) {
293
292
const w = model . widgets [ i ] ;
294
293
if ( w === widget && w . getNestedPickable ( ) ) {
295
294
activateHandle ( w ) ;
296
295
model . activeWidget = w ;
296
+ wantRender = true ;
297
297
} else {
298
+ wantRender ||= ! ! w . getActiveState ( ) ;
298
299
w . deactivateAllHandles ( ) ;
299
300
}
300
301
}
301
- // Ken FIXME
302
- model . _interactor . render ( ) ;
302
+ }
303
+
304
+ if ( wantRender ) {
303
305
model . _interactor . render ( ) ;
304
306
}
305
307
}
@@ -524,17 +526,17 @@ function vtkWidgetManager(publicAPI, model) {
524
526
// do we require a new capture?
525
527
if ( ! model . _capturedBuffers || model . captureOn === CaptureOn . MOUSE_MOVE ) {
526
528
await captureBuffers ( x , y , x , y ) ;
527
- }
528
-
529
- // or do we need a pixel that is outside the last capture?
530
- const capturedRegion = model . _capturedBuffers . area ;
531
- if (
532
- x < capturedRegion [ 0 ] ||
533
- x > capturedRegion [ 2 ] ||
534
- y < capturedRegion [ 1 ] ||
535
- y > capturedRegion [ 3 ]
536
- ) {
537
- await captureBuffers ( x , y , x , y ) ;
529
+ } else {
530
+ // or do we need a pixel that is outside the last capture?
531
+ const capturedRegion = model . _capturedBuffers . area ;
532
+ if (
533
+ x < capturedRegion [ 0 ] ||
534
+ x > capturedRegion [ 2 ] ||
535
+ y < capturedRegion [ 1 ] ||
536
+ y > capturedRegion [ 3 ]
537
+ ) {
538
+ await captureBuffers ( x , y , x , y ) ;
539
+ }
538
540
}
539
541
540
542
model . selections = model . _capturedBuffers . generateSelection ( x , y , x , y ) ;
0 commit comments