mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix: fix inline background color wrap rendering
This commit is contained in:
parent
6020386bbe
commit
ea5be244dc
@ -714,8 +714,22 @@ export class CanvasRenderer extends Renderer {
|
||||
|
||||
if (!isTransparent(styles.backgroundColor)) {
|
||||
this.ctx.fillStyle = asString(styles.backgroundColor);
|
||||
|
||||
if (styles.display === DISPLAY.INLINE) {
|
||||
for (const textNode of paint.container.textNodes) {
|
||||
for (const textBound of textNode.textBounds) {
|
||||
this.ctx.fillRect(
|
||||
textBound.bounds.left,
|
||||
textBound.bounds.top,
|
||||
textBound.bounds.width,
|
||||
textBound.bounds.height
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
await this.renderBackgroundImage(paint.container);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user