diff --git a/src/client/lazy-app/Compress/Output/custom-els/PinchZoom/index.ts b/src/client/lazy-app/Compress/Output/custom-els/PinchZoom/index.ts index a14514d3..9e5acd4f 100644 --- a/src/client/lazy-app/Compress/Output/custom-els/PinchZoom/index.ts +++ b/src/client/lazy-app/Compress/Output/custom-els/PinchZoom/index.ts @@ -81,6 +81,7 @@ function createPoint(): SVGPoint { } const MIN_SCALE = 0.01; +const MAX_SCALE = 100000; export default class PinchZoom extends HTMLElement { // The element that we'll transform. @@ -244,6 +245,9 @@ export default class PinchZoom extends HTMLElement { // Avoid scaling to zero if (scale < MIN_SCALE) return; + // Avoid scaling to very large values + if (scale > MAX_SCALE) return; + // Return if there's no change if (scale === this.scale && x === this.x && y === this.y) return;