This commit is contained in:
Gustavo Toyota 2023-07-14 15:12:58 +00:00 committed by GitHub
commit d153687bcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -714,7 +714,21 @@ export class CanvasRenderer extends Renderer {
if (!isTransparent(styles.backgroundColor)) {
this.ctx.fillStyle = asString(styles.backgroundColor);
this.ctx.fill();
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);