Skip to content

Commit be1a26f

Browse files
committed
优化文本组件对齐功能-支持文本溢出组件范围时的多组件对齐
1 parent a5758ce commit be1a26f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/modules/elements/ElementText.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ export default class ElementText extends ElementRect implements IElementText {
246246
return (this.model.data as ITextData).lines.filter(line => line.isTailBreak).length;
247247
}
248248

249+
get alignCoords(): IPoint[] {
250+
return CommonUtils.getBoxByPoints([...super.alignCoords, ...this._getTextRotateRenderCoords()]);
251+
}
252+
253+
get alignOutlineCoords(): IPoint[][] {
254+
return [CommonUtils.getBoxByPoints([...super.alignOutlineCoords.flat(), ...this._getTextRotateRenderCoords()])];
255+
}
256+
249257
constructor(model: ElementObject, shield: IStageShield) {
250258
super(model, shield);
251259
this._undoRedo = new UndoRedo();

0 commit comments

Comments
 (0)