fix(editor): 拖动组件进画布后,父容器位置计算有误 (#565)

Co-authored-by: fanliming <fanlm@novastar.tech>
This commit is contained in:
leon Li 2024-01-10 16:39:15 +08:00 committed by GitHub
parent 84cbc745c7
commit 115123a0bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,8 +210,8 @@ const dropHandler = async (e: DragEvent) => {
if (parentEl && doc) {
const { left: parentLeft, top: parentTop } = getOffset(parentEl);
left = left - calcValueByFontsize(doc, parentLeft);
top = top - calcValueByFontsize(doc, parentTop);
left = left - calcValueByFontsize(doc, parentLeft) * zoom.value;
top = top - calcValueByFontsize(doc, parentTop) * zoom.value;
}
}