mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 水平居中
This commit is contained in:
parent
940b08b2c5
commit
dd1ec53064
@ -539,8 +539,8 @@ class Editor extends BaseService {
|
||||
const doc = stage?.renderer.contentWindow?.document;
|
||||
|
||||
if (doc) {
|
||||
const parentEl = doc.getElementById(`${parent.id}`);
|
||||
const el = doc.getElementById(`${node.id}`);
|
||||
const parentEl = el?.offsetParent;
|
||||
if (parentEl && el) {
|
||||
node.style.left = (parentEl.clientWidth - el.clientWidth) / 2;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user