actual scale from anchor
This commit is contained in:
parent
d597aa9ae0
commit
28a200ee13
1 changed files with 2 additions and 1 deletions
|
@ -54,7 +54,8 @@ export default defineComponent({
|
||||||
panToAnchor.value = (anchor: SVGRectElement) => {
|
panToAnchor.value = (anchor: SVGRectElement) => {
|
||||||
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 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 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