aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/services/ldzoom.ts
diff options
context:
space:
mode:
authorzeroinformatique2021-07-03 00:48:53 +0200
committerGitHub2021-07-03 00:48:53 +0200
commitb6605e2c4ee73ac8b994624098344db5e44ac07d (patch)
tree5ed06cc5ecdabe070f6fdb9bc4f9a8a3b435cbe6 /viewer/src/services/ldzoom.ts
parent08ac32103fb5f8cca1861267dfd07a7c0d2faf62 (diff)
parent1f0377c1b4c2959c73fe4e368673f057ef369917 (diff)
downloadldgallery-b6605e2c4ee73ac8b994624098344db5e44ac07d.tar.gz
Merge pull request #302 from ldgallery/oz-types-normalization
viewer: types normalization
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,