File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -152,9 +152,11 @@ export function getZoomLevel(chart) {
152
152
let max = 1 ;
153
153
each ( chart . scales , function ( scale ) {
154
154
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
+ }
158
160
} ) ;
159
161
return min < 1 ? min : max ;
160
162
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function createEnabler(chart, state) {
15
15
return true ;
16
16
}
17
17
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 ) )
19
19
) {
20
20
call ( panOptions . onPanRejected , [ { chart, event} ] ) ;
21
21
return false ;
You can’t perform that action at this time.
0 commit comments