File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,22 @@ function setPanAndZoom(
3434 } ;
3535 panAndZoomAreaElement . addEventListener ( "mousemove" , clearPinchPoint , { once : true } ) ;
3636 }
37- // Multiplying with 0.01 to make the zooming less sensitive
37+
38+ let sensitivity = 0.008 ;
39+ function tooMuchScroll ( ) {
40+ if ( e . deltaY > 30 || e . deltaY < - 30 ) {
41+ return true ;
42+ }
43+ }
44+ if ( tooMuchScroll ( ) ) {
45+ // If the user scrolls too much, reduce the sensitivity
46+ // this mostly happens when the user uses mouse wheel to scroll
47+ // probably not the best way to handle this, but works for now
48+ sensitivity = 0.001 ;
49+ }
50+
3851 // Multiplying with scale to make the zooming feel consistent
39- let scale = props . scale - e . deltaY * 0.008 * props . scale ;
52+ let scale = props . scale - e . deltaY * sensitivity * props . scale ;
4053 scale = Math . min ( Math . max ( scale , zoomLimits . min ) , zoomLimits . max ) ;
4154 props . scale = scale ;
4255 nextTick ( ( ) => {
You can’t perform that action at this time.
0 commit comments