feat(editor): fixed布局水平居中处理

This commit is contained in:
teeniechen 2023-08-31 14:43:21 +08:00 committed by roymondchen
parent 372c36893d
commit 2ccf47f7dd

View File

@ -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;
}