mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(editor): fixed布局水平居中处理
This commit is contained in:
parent
372c36893d
commit
2ccf47f7dd
@ -648,7 +648,7 @@ class Editor extends BaseService {
|
||||
|
||||
if (doc) {
|
||||
const el = doc.getElementById(`${node.id}`);
|
||||
const parentEl = el?.offsetParent;
|
||||
const parentEl = layout === Layout.FIXED ? doc.body : el?.offsetParent;
|
||||
if (parentEl && el) {
|
||||
node.style.left = (parentEl.clientWidth - el.clientWidth) / 2;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user