From af6694f890b94c5dbcc71e624fe2c77d7d333b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 9 Jan 2021 18:40:30 +0100 Subject: [PATCH] fix scaling (duh) --- app/src/components/SVGContent.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/SVGContent.vue b/app/src/components/SVGContent.vue index 5311ad6..36ef845 100644 --- a/app/src/components/SVGContent.vue +++ b/app/src/components/SVGContent.vue @@ -55,7 +55,7 @@ export default defineComponent({ const transform = pz.getTransform(); const currentRatio = svg.clientWidth * transform.scale / svg.viewBox.baseVal.width; const ratio = svg.clientWidth / svg.viewBox.baseVal.width; - const targetScale = anchor.width.baseVal.value * ratio / window.innerWidth; + const targetScale = window.innerWidth / (anchor.width.baseVal.value * ratio); const svgTargetX = anchor.x.baseVal.value + anchor.width.baseVal.value / 2; const svgTargetY = anchor.y.baseVal.value + anchor.height.baseVal.value / 2;