build fixes, text underline fixes

This commit is contained in:
Anton Lavrenov
2019-02-06 12:46:21 -05:00
parent 08b3fb159e
commit 33d64e194c
6 changed files with 60 additions and 7 deletions

View File

@@ -180,14 +180,14 @@ export class Text extends Shape {
context.save();
context.beginPath();
context.moveTo(0, Math.round(lineHeightPx / 2));
context.moveTo(0, Math.round(fontSize / 2));
spacesNumber = text.split(' ').length - 1;
oneWord = spacesNumber === 0;
lineWidth =
align === JUSTIFY && lastLine && !oneWord
? totalWidth - padding * 2
: width;
context.lineTo(Math.round(lineWidth), Math.round(lineHeightPx / 2));
context.lineTo(Math.round(lineWidth), Math.round(fontSize / 2));
// I have no idea what is real ratio
// just /15 looks good enough