aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/services/ldzoom.ts
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/services/ldzoom.ts')
-rw-r--r--viewer/src/services/ldzoom.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/viewer/src/services/ldzoom.ts b/viewer/src/services/ldzoom.ts
index 0fb0848..33a64c8 100644
--- a/viewer/src/services/ldzoom.ts
+++ b/viewer/src/services/ldzoom.ts
@@ -17,6 +17,7 @@
17-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/ 18*/
19 19
20import { PictureProperties, Resolution } from "@/@types/gallery";
20import "hammerjs"; 21import "hammerjs";
21 22
22/** 23/**
@@ -25,7 +26,7 @@ import "hammerjs";
25export default class LdZoom { 26export default class LdZoom {
26 readonly containerElement: HTMLDivElement; 27 readonly containerElement: HTMLDivElement;
27 readonly imageElement: HTMLImageElement; 28 readonly imageElement: HTMLImageElement;
28 readonly pictureProperties: Gallery.PictureProperties; 29 readonly pictureProperties: PictureProperties;
29 readonly maxScaleFactor: number; 30 readonly maxScaleFactor: number;
30 readonly scrollZoomSpeed: number; 31 readonly scrollZoomSpeed: number;
31 scaleFactor: number = 0.0; 32 scaleFactor: number = 0.0;
@@ -33,7 +34,7 @@ export default class LdZoom {
33 constructor( 34 constructor(
34 containerElement: HTMLDivElement, 35 containerElement: HTMLDivElement,
35 imageElement: HTMLImageElement, 36 imageElement: HTMLImageElement,
36 pictureProperties: Gallery.PictureProperties, 37 pictureProperties: PictureProperties,
37 maxScaleFactor: number, 38 maxScaleFactor: number,
38 scrollZoomSpeed: number 39 scrollZoomSpeed: number
39 ) { 40 ) {
@@ -83,7 +84,7 @@ export default class LdZoom {
83 /** 84 /**
84 * Returns the picture resolution as it should be displayed. 85 * Returns the picture resolution as it should be displayed.
85 */ 86 */
86 private getDisplayResolution(): Gallery.Resolution { 87 private getDisplayResolution(): Resolution {
87 return { 88 return {
88 width: this.pictureProperties.resolution.width * this.scaleFactor, 89 width: this.pictureProperties.resolution.width * this.scaleFactor,
89 height: this.pictureProperties.resolution.height * this.scaleFactor, 90 height: this.pictureProperties.resolution.height * this.scaleFactor,