File tree Expand file tree Collapse file tree
Sources/Interaction/Style/InteractorStyleTrackballCamera Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,8 +36,12 @@ function vtkInteractorStyleTrackballCamera(publicAPI, model) {
3636 break ;
3737
3838 case States . IS_DOLLY :
39- publicAPI . handleMouseDolly ( renderer , pos ) ;
40- publicAPI . invokeInteractionEvent ( { type : 'InteractionEvent' } ) ;
39+ // Wheel zoom uses the dolly state too, we should ignore pointer movement
40+ // so the mouse position does not amplify wheel zoom while scrolling.
41+ if ( ! model . wheelDolly ) {
42+ publicAPI . handleMouseDolly ( renderer , pos ) ;
43+ publicAPI . invokeInteractionEvent ( { type : 'InteractionEvent' } ) ;
44+ }
4145 break ;
4246
4347 case States . IS_SPIN :
@@ -154,12 +158,14 @@ function vtkInteractorStyleTrackballCamera(publicAPI, model) {
154158
155159 //----------------------------------------------------------------------------
156160 publicAPI . handleStartMouseWheel = ( ) => {
161+ model . wheelDolly = true ;
157162 publicAPI . startDolly ( ) ;
158163 } ;
159164
160165 //--------------------------------------------------------------------------
161166 publicAPI . handleEndMouseWheel = ( ) => {
162167 publicAPI . endDolly ( ) ;
168+ model . wheelDolly = false ;
163169 } ;
164170
165171 //----------------------------------------------------------------------------
@@ -448,6 +454,7 @@ function vtkInteractorStyleTrackballCamera(publicAPI, model) {
448454const DEFAULT_VALUES = {
449455 motionFactor : 10.0 ,
450456 zoomFactor : 10.0 ,
457+ wheelDolly : false ,
451458} ;
452459
453460// ----------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments