diff --git a/app/src/components/SVGContent.vue b/app/src/components/SVGContent.vue index a6dc675..5311ad6 100644 --- a/app/src/components/SVGContent.vue +++ b/app/src/components/SVGContent.vue @@ -54,7 +54,8 @@ export default defineComponent({ panToAnchor.value = (anchor: SVGRectElement) => { const transform = pz.getTransform(); const currentRatio = svg.clientWidth * transform.scale / svg.viewBox.baseVal.width; - const targetScale = 1; // todo + const ratio = svg.clientWidth / svg.viewBox.baseVal.width; + const targetScale = anchor.width.baseVal.value * ratio / window.innerWidth; const svgTargetX = anchor.x.baseVal.value + anchor.width.baseVal.value / 2; const svgTargetY = anchor.y.baseVal.value + anchor.height.baseVal.value / 2;