Skip to content

Commit

Permalink
fix(editor): 单选水平居中
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Nov 4, 2022
1 parent c2e8a1c commit e8c53c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/editor/src/services/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Editor extends BaseService {
'copy',
'paste',
'doPaste',
'duAlignCenter',
'doAlignCenter',
'alignCenter',
'moveLayer',
'moveToContainer',
Expand Down Expand Up @@ -623,7 +623,11 @@ class Editor extends BaseService {

const newNode = await this.update(newNodes);

await stage?.multiSelect(newNodes.map((node) => node.id));
if (newNodes.length > 1) {
await stage?.multiSelect(newNodes.map((node) => node.id));
} else {
await stage?.select(newNodes[0].id);
}

return newNode;
}
Expand Down

0 comments on commit e8c53c2

Please sign in to comment.