fix scaling (duh)
This commit is contained in:
parent
28a200ee13
commit
af6694f890
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ export default defineComponent({
|
||||||
const transform = pz.getTransform();
|
const transform = pz.getTransform();
|
||||||
const currentRatio = svg.clientWidth * transform.scale / svg.viewBox.baseVal.width;
|
const currentRatio = svg.clientWidth * transform.scale / svg.viewBox.baseVal.width;
|
||||||
const ratio = svg.clientWidth / 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 svgTargetX = anchor.x.baseVal.value + anchor.width.baseVal.value / 2;
|
||||||
const svgTargetY = anchor.y.baseVal.value + anchor.height.baseVal.value / 2;
|
const svgTargetY = anchor.y.baseVal.value + anchor.height.baseVal.value / 2;
|
||||||
|
|
Loading…
Reference in a new issue