@@ -3,7 +3,7 @@ import vtkAbstractWidget from 'vtk.js/Sources/Interaction/Wi
33import vtkImageCroppingRegionsRepresentation from 'vtk.js/Sources/Interaction/Widgets/ImageCroppingRegionsRepresentation' ;
44import Constants from 'vtk.js/Sources/Interaction/Widgets/ImageCroppingRegionsWidget/Constants' ;
55
6- const { vtkErrorMacro } = macro ;
6+ const { vtkErrorMacro, VOID , EVENT_ABORT } = macro ;
77const { WidgetState, SliceNormals } = Constants ;
88
99const events = [
@@ -168,21 +168,21 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
168168
169169 publicAPI . pressAction = ( ) => {
170170 if ( widgetState === WidgetState . IDLE ) {
171- return true ;
171+ return VOID ;
172172 }
173173 isCropMoving = true ;
174174 // prevent low-priority observers from receiving the event
175- return false ;
175+ return EVENT_ABORT ;
176176 } ;
177177
178178 publicAPI . hoverAction = ( ) => {
179179 if ( ! model . widgetRep ) {
180- return ;
180+ return VOID ;
181181 }
182182
183183 // Do not change widget state if moving the crop region.
184184 if ( isCropMoving ) {
185- return ;
185+ return VOID ;
186186 }
187187
188188 const sliceOrientation = model . imageMapper . getCurrentSlicingMode ( ) ;
@@ -217,7 +217,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
217217 break ;
218218 default :
219219 vtkErrorMacro ( 'Invalid slice orientation' ) ;
220- return ;
220+ return VOID ;
221221 }
222222
223223 let leftBottom , // [left, bottom]
@@ -244,7 +244,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
244244 break ;
245245 default :
246246 vtkErrorMacro ( 'Invalid camera view-up' ) ;
247- return ;
247+ return VOID ;
248248 }
249249
250250 let left ,
@@ -309,12 +309,13 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
309309
310310 // console.log('state', widgetState);
311311 setCursor ( widgetState ) ;
312+ return VOID ;
312313 } ;
313314
314315
315316 publicAPI . moveAction = ( ) => {
316317 if ( widgetState === WidgetState . IDLE ) {
317- return true ;
318+ return VOID ;
318319 }
319320
320321 const mouse = publicAPI . get2DPointerPosition ( ) ;
@@ -360,7 +361,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
360361 break ;
361362 default :
362363 vtkErrorMacro ( 'Invalid slice orientation' ) ;
363- return true ;
364+ return VOID ;
364365 }
365366
366367 let left ,
@@ -391,7 +392,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
391392 break ;
392393 default :
393394 vtkErrorMacro ( 'Invalid camera view-up' ) ;
394- return true ;
395+ return VOID ;
395396 }
396397
397398 // Is there a better way than using a fudge factor?
@@ -450,7 +451,7 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
450451 break ;
451452 default :
452453 vtkErrorMacro ( 'Invalid camera view-up' ) ;
453- return true ;
454+ return VOID ;
454455 }
455456
456457 // assign new plane values
@@ -469,13 +470,13 @@ function vtkImageCroppingRegionsWidget(publicAPI, model) {
469470 break ;
470471 default :
471472 vtkErrorMacro ( 'Invalid slice orientation' ) ;
472- return true ;
473+ return VOID ;
473474 }
474475
475476 model . widgetRep . setPlanePositions ( ...planes ) ;
476477 model . interactor . render ( ) ;
477478
478- return false ;
479+ return EVENT_ABORT ;
479480 } ;
480481
481482 publicAPI . endMoveAction = ( ) => {
0 commit comments