mirror of
https://github.com/konvajs/konva.git
synced 2025-11-24 16:53:06 +08:00
underline width fix
This commit is contained in:
5
konva.js
5
konva.js
@@ -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
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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();
|
||||
|
||||
@@ -342,7 +342,7 @@ suite('Text', function(){
|
||||
x: 10,
|
||||
y: 10,
|
||||
text: 'hello\nworld',
|
||||
fontSize: 15,
|
||||
fontSize: 80,
|
||||
fill: 'red',
|
||||
letterSpacing: 5,
|
||||
textDecoration: 'underline',
|
||||
|
||||
Reference in New Issue
Block a user