diff options
Diffstat (limited to 'viewer/src/services/ldzoom.ts')
-rw-r--r-- | viewer/src/services/ldzoom.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/viewer/src/services/ldzoom.ts b/viewer/src/services/ldzoom.ts index 22d4699..33a64c8 100644 --- a/viewer/src/services/ldzoom.ts +++ b/viewer/src/services/ldzoom.ts | |||
@@ -17,8 +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 | ||
20 | // polyfill still required for IE and Safari, see https://caniuse.com/#feat=resizeobserver | 20 | import { PictureProperties, Resolution } from "@/@types/gallery"; |
21 | import ResizeObserver from "resize-observer-polyfill"; | ||
22 | import "hammerjs"; | 21 | import "hammerjs"; |
23 | 22 | ||
24 | /** | 23 | /** |
@@ -27,7 +26,7 @@ import "hammerjs"; | |||
27 | export default class LdZoom { | 26 | export default class LdZoom { |
28 | readonly containerElement: HTMLDivElement; | 27 | readonly containerElement: HTMLDivElement; |
29 | readonly imageElement: HTMLImageElement; | 28 | readonly imageElement: HTMLImageElement; |
30 | readonly pictureProperties: Gallery.PictureProperties; | 29 | readonly pictureProperties: PictureProperties; |
31 | readonly maxScaleFactor: number; | 30 | readonly maxScaleFactor: number; |
32 | readonly scrollZoomSpeed: number; | 31 | readonly scrollZoomSpeed: number; |
33 | scaleFactor: number = 0.0; | 32 | scaleFactor: number = 0.0; |
@@ -35,7 +34,7 @@ export default class LdZoom { | |||
35 | constructor( | 34 | constructor( |
36 | containerElement: HTMLDivElement, | 35 | containerElement: HTMLDivElement, |
37 | imageElement: HTMLImageElement, | 36 | imageElement: HTMLImageElement, |
38 | pictureProperties: Gallery.PictureProperties, | 37 | pictureProperties: PictureProperties, |
39 | maxScaleFactor: number, | 38 | maxScaleFactor: number, |
40 | scrollZoomSpeed: number | 39 | scrollZoomSpeed: number |
41 | ) { | 40 | ) { |
@@ -85,7 +84,7 @@ export default class LdZoom { | |||
85 | /** | 84 | /** |
86 | * Returns the picture resolution as it should be displayed. | 85 | * Returns the picture resolution as it should be displayed. |
87 | */ | 86 | */ |
88 | private getDisplayResolution(): Gallery.Resolution { | 87 | private getDisplayResolution(): Resolution { |
89 | return { | 88 | return { |
90 | width: this.pictureProperties.resolution.width * this.scaleFactor, | 89 | width: this.pictureProperties.resolution.width * this.scaleFactor, |
91 | height: this.pictureProperties.resolution.height * this.scaleFactor, | 90 | height: this.pictureProperties.resolution.height * this.scaleFactor, |