1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

[Editor] Add the ability to resize an editor in using a pinch gesture

This commit is contained in:
Calixte Denizet 2024-12-12 15:05:22 +01:00
parent 8fa4398266
commit 4ed7f7f1ee
5 changed files with 130 additions and 22 deletions

View file

@ -492,6 +492,7 @@ const PDFViewerApplication = {
mlManager: this.mlManager,
abortSignal: this._globalAbortController.signal,
enableHWA,
supportsPinchToZoom: this.supportsPinchToZoom,
});
this.pdfViewer = pdfViewer;

View file

@ -126,6 +126,8 @@ function isValidAnnotationEditorMode(mode) {
* mode.
* @property {boolean} [enableHWA] - Enables hardware acceleration for
* rendering. The default value is `false`.
* @property {boolean} [supportsPinchToZoom] - Enable zooming on pinch gesture.
* The default value is `true`.
*/
class PDFPageViewBuffer {
@ -248,6 +250,8 @@ class PDFViewer {
#scaleTimeoutId = null;
#supportsPinchToZoom = true;
#textLayerMode = TextLayerMode.ENABLE;
/**
@ -316,6 +320,7 @@ class PDFViewer {
this.pageColors = options.pageColors || null;
this.#mlManager = options.mlManager || null;
this.#enableHWA = options.enableHWA || false;
this.#supportsPinchToZoom = options.supportsPinchToZoom !== false;
this.defaultRenderingQueue = !options.renderingQueue;
if (
@ -911,7 +916,8 @@ class PDFViewer {
this.#enableUpdatedAddImage,
this.#enableNewAltTextWhenAddingImage,
this.#mlManager,
this.#editorUndoBar
this.#editorUndoBar,
this.#supportsPinchToZoom
);
eventBus.dispatch("annotationeditoruimanager", {
source: this,