修改角度

main
suixy 2 months ago
parent c526b721c4
commit f099f0d756

@ -279,6 +279,7 @@ const getLineData = (fromId, toId) => {
const dy = y2 - y1; const dy = y2 - y1;
const distance = Math.sqrt(dx * dx + dy * dy); const distance = Math.sqrt(dx * dx + dy * dy);
let rad = Math.atan2(dy, dx); let rad = Math.atan2(dy, dx);
console.log(rad * (180 / Math.PI))
let deg = rad * (180 / Math.PI) - props.boxPos.rotate let deg = rad * (180 / Math.PI) - props.boxPos.rotate
if (deg < 0) deg += 360; if (deg < 0) deg += 360;
lineData.value = {distance, degree: deg} lineData.value = {distance, degree: deg}

Loading…
Cancel
Save