mirror of
https://github.com/konvajs/konva.git
synced 2026-01-23 13:26:07 +08:00
some more justify fixes
This commit is contained in:
6
konva.js
6
konva.js
@@ -13140,7 +13140,7 @@
|
||||
var letter = text[li];
|
||||
// skip justify for the last line
|
||||
if ((letter === ' ') && (n !== textArrLen - 1) && align === JUSTIFY) {
|
||||
context.translate(((totalWidth - width) / spacesNumber), 0);
|
||||
context.translate(Math.floor((totalWidth - width) / spacesNumber), 0);
|
||||
}
|
||||
this.partialText = letter;
|
||||
context.fillStrokeShape(this);
|
||||
@@ -13364,6 +13364,10 @@
|
||||
}
|
||||
dummyContext.restore();
|
||||
this.textHeight = fontSize;
|
||||
// var maxTextWidth = 0;
|
||||
// for(var j = 0; j < this.textArr.length; j++) {
|
||||
// maxTextWidth = Math.max(maxTextWidth, this.textArr[j].width);
|
||||
// }
|
||||
this.textWidth = textWidth;
|
||||
}
|
||||
};
|
||||
|
||||
6
konva.min.js
vendored
6
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -160,7 +160,7 @@
|
||||
var letter = text[li];
|
||||
// skip justify for the last line
|
||||
if ((letter === ' ') && (n !== textArrLen - 1) && align === JUSTIFY) {
|
||||
context.translate(((totalWidth - width) / spacesNumber), 0);
|
||||
context.translate(Math.floor((totalWidth - width) / spacesNumber), 0);
|
||||
}
|
||||
this.partialText = letter;
|
||||
context.fillStrokeShape(this);
|
||||
@@ -384,6 +384,10 @@
|
||||
}
|
||||
dummyContext.restore();
|
||||
this.textHeight = fontSize;
|
||||
// var maxTextWidth = 0;
|
||||
// for(var j = 0; j < this.textArr.length; j++) {
|
||||
// maxTextWidth = Math.max(maxTextWidth, this.textArr[j].width);
|
||||
// }
|
||||
this.textWidth = textWidth;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user