|
@@ -341,7 +341,7 @@ const renderSvgItem = (item: any) => {
|
|
|
/** 设置元素位置 */
|
|
|
async function setModelPostion(item: any, x: number, y: number, repeatEdit?: boolean) {
|
|
|
// console.log(item)
|
|
|
- // console.log('位置',x,y)
|
|
|
+ console.log('位置',x,y)
|
|
|
if (item) {
|
|
|
const g = document.querySelector("#" + item.id)!; // svg元素
|
|
|
const el: HTMLElement = document.querySelector(`[data-id=${item.id}]`)!; // svg元素的背景div
|
|
@@ -359,7 +359,7 @@ async function setModelPostion(item: any, x: number, y: number, repeatEdit?: boo
|
|
|
if (!moveData.noteCoords.length) {
|
|
|
await initNoteCoord()
|
|
|
}
|
|
|
- const targetX = moveData.noteCoords[item.noteIdx].x + item.noteRelativeX, targetY = moveData.noteCoords[item.noteIdx].y + item.noteRelativeY;
|
|
|
+ const targetX = moveData.noteCoords[item.noteIdx].x + item.noteRelativeX*(state.zoom/0.8), targetY = moveData.noteCoords[item.noteIdx].y + item.noteRelativeY*(state.zoom/0.8);
|
|
|
const original = document.getElementById(item.id)?.getBoundingClientRect() || { x: 0, y: 0 };
|
|
|
tsX = targetX - original.x;
|
|
|
tsY = targetY - original.y;
|