underline drawing bug fixes

This commit is contained in:
Anton Lavrenov
2016-12-07 17:13:34 -05:00
parent 37d6eb6541
commit 265e365b12
6 changed files with 15 additions and 6 deletions

View File

@@ -140,6 +140,7 @@
if (textDecoration === 'underline') {
context.save();
context.beginPath();
context.moveTo(0, Math.round(lineHeightPx / 2));
context.lineTo(Math.round(width), Math.round(lineHeightPx / 2));
// context

View File

@@ -82,6 +82,9 @@
var fontSize = this.fontSize();
var glyphInfo = this.glyphInfo;
if (textDecoration === 'underline') {
context.beginPath();
}
for(var i = 0; i < glyphInfo.length; i++) {
context.save();