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