File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,9 +152,11 @@ export function getZoomLevel(chart) {
152152 let max = 1 ;
153153 each ( chart . scales , function ( scale ) {
154154 const origRange = getOriginalRange ( state , scale . id ) ;
155- const level = Math . round ( origRange / ( scale . max - scale . min ) * 100 ) / 100 ;
156- min = Math . min ( min , level ) ;
157- max = Math . max ( max , level ) ;
155+ if ( origRange ) {
156+ const level = Math . round ( origRange / ( scale . max - scale . min ) * 100 ) / 100 ;
157+ min = Math . min ( min , level ) ;
158+ max = Math . max ( max , level ) ;
159+ }
158160 } ) ;
159161 return min < 1 ? min : max ;
160162}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function createEnabler(chart, state) {
1515 return true ;
1616 }
1717 if ( ! state . panning && event . pointerType === 'mouse' && (
18- keyNotPressed ( getModifierKey ( panOptions ) , srcEvent ) || keyPressed ( getModifierKey ( zoomOptions ) , srcEvent ) )
18+ keyNotPressed ( getModifierKey ( panOptions ) , srcEvent ) || keyPressed ( getModifierKey ( zoomOptions . drag ) , srcEvent ) )
1919 ) {
2020 call ( panOptions . onPanRejected , [ { chart, event} ] ) ;
2121 return false ;
You can’t perform that action at this time.
0 commit comments