Merge pull request #14495 from emilio/ctrl-wheel
web: Read WheelEvent.deltaMode before deltas.
This commit is contained in:
commit
5c3b245958
10
web/app.js
10
web/app.js
@ -2691,13 +2691,17 @@ function webViewerWheel(evt) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It is important that we query deltaMode before delta{X,Y}, so that
|
||||||
|
// Firefox doesn't switch to DOM_DELTA_PIXEL mode for compat with other
|
||||||
|
// browsers, see https://bugzilla.mozilla.org/show_bug.cgi?id=1392460.
|
||||||
|
const deltaMode = evt.deltaMode;
|
||||||
|
const delta = normalizeWheelEventDirection(evt);
|
||||||
const previousScale = pdfViewer.currentScale;
|
const previousScale = pdfViewer.currentScale;
|
||||||
|
|
||||||
const delta = normalizeWheelEventDirection(evt);
|
|
||||||
let ticks = 0;
|
let ticks = 0;
|
||||||
if (
|
if (
|
||||||
evt.deltaMode === WheelEvent.DOM_DELTA_LINE ||
|
deltaMode === WheelEvent.DOM_DELTA_LINE ||
|
||||||
evt.deltaMode === WheelEvent.DOM_DELTA_PAGE
|
deltaMode === WheelEvent.DOM_DELTA_PAGE
|
||||||
) {
|
) {
|
||||||
// For line-based devices, use one tick per event, because different
|
// For line-based devices, use one tick per event, because different
|
||||||
// OSs have different defaults for the number lines. But we generally
|
// OSs have different defaults for the number lines. But we generally
|
||||||
|
Loading…
x
Reference in New Issue
Block a user