mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Merge pull request #531 from VladimirTechMan/master
Do not recalculate additionalWidth on every line of multiline text
This commit is contained in:
commit
4571ea16b7
@ -356,11 +356,11 @@ export class Text extends Shape {
|
||||
|
||||
this.textArr = [];
|
||||
getDummyContext().font = this._getContextFont();
|
||||
var additionalWidth = shouldAddEllipsis
|
||||
? this._getTextWidth(ELLIPSIS)
|
||||
: 0;
|
||||
for (var i = 0, max = lines.length; i < max; ++i) {
|
||||
var line = lines[i];
|
||||
var additionalWidth = shouldAddEllipsis
|
||||
? this._getTextWidth(ELLIPSIS)
|
||||
: 0;
|
||||
|
||||
var lineWidth = this._getTextWidth(line);
|
||||
if (fixedWidth && lineWidth > maxWidth) {
|
||||
|
Loading…
Reference in New Issue
Block a user