fix scaling (duh)

This commit is contained in:
Tomáš Mládek 2021-01-09 18:40:30 +01:00
parent 28a200ee13
commit af6694f890

View file

@ -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;