File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ plugins: {
103103 // (percentage of zoom on a wheel event)
104104 speed: 0.1 ,
105105
106+ // Minimal zoom distance required before actually applying zoom
107+ threshold: 2 ,
108+
106109 // On category scale, minimal zoom level before actually applying zoom
107110 sensitivity: 3 ,
108111
Original file line number Diff line number Diff line change @@ -482,7 +482,8 @@ var zoomPlugin = {
482482 chartInstance . $zoom . _dragZoomStart = null ;
483483 chartInstance . $zoom . _dragZoomEnd = null ;
484484
485- if ( dragDistanceX <= 0 && dragDistanceY <= 0 ) {
485+ var zoomThreshold = options . zoom && options . zoom . threshold || 0 ;
486+ if ( dragDistanceX <= zoomThreshold && dragDistanceY <= zoomThreshold ) {
486487 return ;
487488 }
488489
You can’t perform that action at this time.
0 commit comments