fix(editor): 从组件树中拖入画布新增的情况如果初始position为fixed不改变布局

This commit is contained in:
roymondchen 2023-11-23 15:47:09 +08:00
parent 33c8f8bf5a
commit b0fcafd089

View File

@ -191,7 +191,11 @@ const dropHandler = async (e: DragEvent) => {
let left = 0;
let position = 'relative';
if (layout === Layout.ABSOLUTE) {
if (style.position === 'fixed') {
position = 'fixed';
top = e.clientY - containerRect.top;
left = e.clientX - containerRect.left;
} else if (layout === Layout.ABSOLUTE) {
position = 'absolute';
top = e.clientY - containerRect.top + scrollTop;
left = e.clientX - containerRect.left + scrollLeft;