aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/services/ldzoom.ts
diff options
context:
space:
mode:
authorZero~Informatique2021-07-02 22:53:16 +0200
committerZero~Informatique2021-07-03 00:05:22 +0200
commit9165cc1efcf7791f78b61b2c51a9de651b1b09aa (patch)
tree111cfdc74ddaf7b19ff27508f16ab84694b27670 /viewer/src/services/ldzoom.ts
parent08ac32103fb5f8cca1861267dfd07a7c0d2faf62 (diff)
downloadldgallery-9165cc1efcf7791f78b61b2c51a9de651b1b09aa.tar.gz
viewer: types normalization - gallery.d.ts
GitHub: closes #301
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,