mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Correct dereferencing of createFontStyle
return value
This commit is contained in:
parent
6020386bbe
commit
3245da2f15
@ -388,10 +388,10 @@ export class CanvasRenderer extends Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isTextInputElement(container) && container.value.length) {
|
if (isTextInputElement(container) && container.value.length) {
|
||||||
const [fontFamily, fontSize] = this.createFontStyle(styles);
|
const [font, fontFamily, fontSize] = this.createFontStyle(styles);
|
||||||
const {baseline} = this.fontMetrics.getMetrics(fontFamily, fontSize);
|
const {baseline} = this.fontMetrics.getMetrics(fontFamily, fontSize);
|
||||||
|
|
||||||
this.ctx.font = fontFamily;
|
this.ctx.font = font;
|
||||||
this.ctx.fillStyle = asString(styles.color);
|
this.ctx.fillStyle = asString(styles.color);
|
||||||
|
|
||||||
this.ctx.textBaseline = 'alphabetic';
|
this.ctx.textBaseline = 'alphabetic';
|
||||||
@ -445,9 +445,9 @@ export class CanvasRenderer extends Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) {
|
} else if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) {
|
||||||
const [fontFamily] = this.createFontStyle(styles);
|
const [font] = this.createFontStyle(styles);
|
||||||
|
|
||||||
this.ctx.font = fontFamily;
|
this.ctx.font = font;
|
||||||
this.ctx.fillStyle = asString(styles.color);
|
this.ctx.fillStyle = asString(styles.color);
|
||||||
|
|
||||||
this.ctx.textBaseline = 'middle';
|
this.ctx.textBaseline = 'middle';
|
||||||
|
Loading…
Reference in New Issue
Block a user