Move the zoomIn/zoomOut functionality into BaseViewer (PR 14038 follow-up)

Given the simplicity of this functionality, we can move it from the default viewer and into the `BaseViewer` class instead. This way, it's possible to support more scripting functionality in the standalone viewer components; please see PR 14038.

Please note that I purposely went with `increaseScale`/`decreaseScale`-method names, rather than using "zoom", to better match the existing `currentScale`/`currentScaleValue` getters/setters that's being used in the `BaseViewer` class.
This commit is contained in:
Jonas Jenwald 2021-09-19 11:54:57 +02:00
parent 83d3bb43f4
commit d9f9fa4f1c
4 changed files with 39 additions and 21 deletions

View file

@ -18,6 +18,7 @@ import { PixelsPerInch } from "pdfjs-lib";
const CSS_UNITS = PixelsPerInch.CSS / PixelsPerInch.PDF;
const DEFAULT_SCALE_VALUE = "auto";
const DEFAULT_SCALE = 1.0;
const DEFAULT_SCALE_DELTA = 1.1;
const MIN_SCALE = 0.1;
const MAX_SCALE = 10.0;
const UNKNOWN_SCALE = 0;
@ -1005,6 +1006,7 @@ export {
binarySearchFirstItem,
CSS_UNITS,
DEFAULT_SCALE,
DEFAULT_SCALE_DELTA,
DEFAULT_SCALE_VALUE,
EventBus,
getActiveOrFocusedElement,