mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-17 02:19:25 +08:00
fix(editor): 从组件树中拖入画布新增的情况如果初始position为fixed不改变布局
This commit is contained in:
parent
33c8f8bf5a
commit
b0fcafd089
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user