@@ -3,7 +3,7 @@ import vtkAbstractWidget from 'vtk.js/Sources/Interaction/Wi
3
3
import vtkImageCroppingRegionsRepresentation from 'vtk.js/Sources/Interaction/Widgets/ImageCroppingRegionsRepresentation' ;
4
4
import Constants from 'vtk.js/Sources/Interaction/Widgets/ImageCroppingRegionsWidget/Constants' ;
5
5
6
- const { vtkErrorMacro } = macro ;
6
+ const { vtkErrorMacro, VOID , EVENT_ABORT } = macro ;
7
7
const { WidgetState, SliceNormals } = Constants ;
8
8
9
9
const events = [
@@ -168,21 +168,21 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
168
168
169
169
publicAPI . pressAction = ( ) => {
170
170
if ( widgetState === WidgetState . IDLE ) {
171
- return true ;
171
+ return VOID ;
172
172
}
173
173
isCropMoving = true ;
174
174
// prevent low-priority observers from receiving the event
175
- return false ;
175
+ return EVENT_ABORT ;
176
176
} ;
177
177
178
178
publicAPI . hoverAction = ( ) => {
179
179
if ( ! model . widgetRep ) {
180
- return ;
180
+ return VOID ;
181
181
}
182
182
183
183
// Do not change widget state if moving the crop region.
184
184
if ( isCropMoving ) {
185
- return ;
185
+ return VOID ;
186
186
}
187
187
188
188
const sliceOrientation = model . imageMapper . getCurrentSlicingMode ( ) ;
@@ -217,7 +217,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
217
217
break ;
218
218
default :
219
219
vtkErrorMacro ( 'Invalid slice orientation' ) ;
220
- return ;
220
+ return VOID ;
221
221
}
222
222
223
223
let leftBottom , // [left, bottom]
@@ -244,7 +244,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
244
244
break ;
245
245
default :
246
246
vtkErrorMacro ( 'Invalid camera view-up' ) ;
247
- return ;
247
+ return VOID ;
248
248
}
249
249
250
250
let left ,
@@ -309,12 +309,13 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
309
309
310
310
// console.log('state', widgetState);
311
311
setCursor ( widgetState ) ;
312
+ return VOID ;
312
313
} ;
313
314
314
315
315
316
publicAPI . moveAction = ( ) => {
316
317
if ( widgetState === WidgetState . IDLE ) {
317
- return true ;
318
+ return VOID ;
318
319
}
319
320
320
321
const mouse = publicAPI . get2DPointerPosition ( ) ;
@@ -360,7 +361,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
360
361
break ;
361
362
default :
362
363
vtkErrorMacro ( 'Invalid slice orientation' ) ;
363
- return true ;
364
+ return VOID ;
364
365
}
365
366
366
367
let left ,
@@ -391,7 +392,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
391
392
break ;
392
393
default :
393
394
vtkErrorMacro ( 'Invalid camera view-up' ) ;
394
- return true ;
395
+ return VOID ;
395
396
}
396
397
397
398
// Is there a better way than using a fudge factor?
@@ -450,7 +451,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
450
451
break ;
451
452
default :
452
453
vtkErrorMacro ( 'Invalid camera view-up' ) ;
453
- return true ;
454
+ return VOID ;
454
455
}
455
456
456
457
// assign new plane values
@@ -469,13 +470,13 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
469
470
break ;
470
471
default :
471
472
vtkErrorMacro ( 'Invalid slice orientation' ) ;
472
- return true ;
473
+ return VOID ;
473
474
}
474
475
475
476
model . widgetRep . setPlanePositions ( ...planes ) ;
476
477
model . interactor . render ( ) ;
477
478
478
- return false ;
479
+ return EVENT_ABORT ;
479
480
} ;
480
481
481
482
publicAPI . endMoveAction = ( ) => {
0 commit comments