fix ellipsis for Konva.Text

This commit is contained in:
Anton Lavrenov
2020-09-16 09:55:40 -05:00
parent 44f79edbbb
commit 0e1afd3d5c
6 changed files with 40 additions and 10 deletions

View File

@@ -427,7 +427,7 @@ export class Text extends Shape<TextConfig> {
// align = this.align(),
shouldWrap = wrap !== NONE,
wrapAtWord = wrap !== CHAR && shouldWrap,
shouldAddEllipsis = this.ellipsis() && !shouldWrap;
shouldAddEllipsis = this.ellipsis();
this.textArr = [];
getDummyContext().font = this._getContextFont();
@@ -509,8 +509,10 @@ export class Text extends Shape<TextConfig> {
);
}
this.textArr.splice(this.textArr.length - 1, 1);
this._addTextLine(lastLine.text + ELLIPSIS);
if (shouldAddEllipsis) {
this.textArr.splice(this.textArr.length - 1, 1);
this._addTextLine(lastLine.text + ELLIPSIS);
}
}
/*