Merge pull request #16026 from calixteman/ptz_mac
Fix pinch-to-zoom on mac for the Firefox builtin viewer
This commit is contained in:
commit
9cea76483a
@ -32,6 +32,7 @@ import {
|
|||||||
CMapCompressionType,
|
CMapCompressionType,
|
||||||
createPromiseCapability,
|
createPromiseCapability,
|
||||||
createValidAbsoluteUrl,
|
createValidAbsoluteUrl,
|
||||||
|
FeatureTest,
|
||||||
InvalidPDFException,
|
InvalidPDFException,
|
||||||
MissingPDFException,
|
MissingPDFException,
|
||||||
OPS,
|
OPS,
|
||||||
@ -89,6 +90,7 @@ export {
|
|||||||
CMapCompressionType,
|
CMapCompressionType,
|
||||||
createPromiseCapability,
|
createPromiseCapability,
|
||||||
createValidAbsoluteUrl,
|
createValidAbsoluteUrl,
|
||||||
|
FeatureTest,
|
||||||
getDocument,
|
getDocument,
|
||||||
getFilenameFromUrl,
|
getFilenameFromUrl,
|
||||||
getPdfFilenameFromUrl,
|
getPdfFilenameFromUrl,
|
||||||
|
@ -38,6 +38,7 @@ import {
|
|||||||
AnnotationEditorType,
|
AnnotationEditorType,
|
||||||
build,
|
build,
|
||||||
createPromiseCapability,
|
createPromiseCapability,
|
||||||
|
FeatureTest,
|
||||||
getDocument,
|
getDocument,
|
||||||
getFilenameFromUrl,
|
getFilenameFromUrl,
|
||||||
getPdfFilenameFromUrl,
|
getPdfFilenameFromUrl,
|
||||||
@ -2695,12 +2696,16 @@ function webViewerWheel(evt) {
|
|||||||
// https://searchfox.org/mozilla-central/rev/d62c4c4d5547064487006a1506287da394b64724/widget/InputData.cpp#618-626
|
// https://searchfox.org/mozilla-central/rev/d62c4c4d5547064487006a1506287da394b64724/widget/InputData.cpp#618-626
|
||||||
let scaleFactor = Math.exp(-evt.deltaY / 100);
|
let scaleFactor = Math.exp(-evt.deltaY / 100);
|
||||||
|
|
||||||
|
const isBuiltInMac =
|
||||||
|
typeof PDFJSDev !== "undefined" &&
|
||||||
|
PDFJSDev.test("MOZCENTRAL") &&
|
||||||
|
FeatureTest.platform.isMac;
|
||||||
const isPinchToZoom =
|
const isPinchToZoom =
|
||||||
evt.ctrlKey &&
|
evt.ctrlKey &&
|
||||||
!PDFViewerApplication._isCtrlKeyDown &&
|
!PDFViewerApplication._isCtrlKeyDown &&
|
||||||
deltaMode === WheelEvent.DOM_DELTA_PIXEL &&
|
deltaMode === WheelEvent.DOM_DELTA_PIXEL &&
|
||||||
evt.deltaX === 0 &&
|
evt.deltaX === 0 &&
|
||||||
Math.abs(scaleFactor - 1) < 0.05 &&
|
(Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) &&
|
||||||
evt.deltaZ === 0;
|
evt.deltaZ === 0;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
Loading…
Reference in New Issue
Block a user