Skip to content

Commit ea5be24

Browse files
committed
fix: fix inline background color wrap rendering
1 parent 6020386 commit ea5be24

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/render/canvas/canvas-renderer.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,21 @@ export class CanvasRenderer extends Renderer {
714714

715715
if (!isTransparent(styles.backgroundColor)) {
716716
this.ctx.fillStyle = asString(styles.backgroundColor);
717-
this.ctx.fill();
717+
718+
if (styles.display === DISPLAY.INLINE) {
719+
for (const textNode of paint.container.textNodes) {
720+
for (const textBound of textNode.textBounds) {
721+
this.ctx.fillRect(
722+
textBound.bounds.left,
723+
textBound.bounds.top,
724+
textBound.bounds.width,
725+
textBound.bounds.height
726+
);
727+
}
728+
}
729+
} else {
730+
this.ctx.fill();
731+
}
718732
}
719733

720734
await this.renderBackgroundImage(paint.container);

0 commit comments

Comments
 (0)