Skip to content

Commit

Permalink
feat(editor): fixed布局水平居中处理
Browse files Browse the repository at this point in the history
  • Loading branch information
teeniechen authored and roymondchen committed Aug 31, 2023
1 parent 372c368 commit 2ccf47f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/editor/src/services/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2ccf47f

Please sign in to comment.