underline width fix

This commit is contained in:
Anton Lavrenov
2016-12-07 17:20:47 -05:00
parent 265e365b12
commit 03c65860e8
4 changed files with 11 additions and 5 deletions

View File

@@ -13087,6 +13087,7 @@
letterSpacing = this.getLetterSpacing(),
textDecoration = this.textDecoration(),
fill = this.fill(),
fontSize = this.fontSize(),
n;
context.setAttr('font', this._getContextFont());
@@ -13123,7 +13124,9 @@
context.beginPath();
context.moveTo(0, Math.round(lineHeightPx / 2));
context.lineTo(Math.round(width), Math.round(lineHeightPx / 2));
// context
// TODO: I have no idea what is real ratio
// just /20 looks good enough
context.lineWidth = fontSize / 20;
context.strokeStyle = fill;
context.stroke();
context.restore();

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -107,6 +107,7 @@
letterSpacing = this.getLetterSpacing(),
textDecoration = this.textDecoration(),
fill = this.fill(),
fontSize = this.fontSize(),
n;
context.setAttr('font', this._getContextFont());
@@ -143,7 +144,9 @@
context.beginPath();
context.moveTo(0, Math.round(lineHeightPx / 2));
context.lineTo(Math.round(width), Math.round(lineHeightPx / 2));
// context
// TODO: I have no idea what is real ratio
// just /20 looks good enough
context.lineWidth = fontSize / 20;
context.strokeStyle = fill;
context.stroke();
context.restore();

View File

@@ -342,7 +342,7 @@ suite('Text', function(){
x: 10,
y: 10,
text: 'hello\nworld',
fontSize: 15,
fontSize: 80,
fill: 'red',
letterSpacing: 5,
textDecoration: 'underline',