Skip to content

Commit 9ffb21a

Browse files
committed
Process rounded span's background.
DEVSIX-1935
1 parent bbfaf8d commit 9ffb21a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/TextRenderer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,15 @@ public void drawBackground(DrawContext drawContext) {
852852
if (isTagged) {
853853
canvas.openTag(new CanvasArtifact());
854854
}
855+
boolean backgroundAreaIsClipped = clipBackgroundArea(drawContext, backgroundArea);
855856
canvas.saveState().setFillColor(background.getColor());
856857
canvas.rectangle(leftBBoxX - background.getExtraLeft(), bottomBBoxY + (float) textRise - background.getExtraBottom(),
857858
backgroundArea.getWidth() + background.getExtraLeft() + background.getExtraRight(),
858859
backgroundArea.getHeight() - (float) textRise + background.getExtraTop() + background.getExtraBottom());
859860
canvas.fill().restoreState();
861+
if (backgroundAreaIsClipped) {
862+
drawContext.getCanvas().restoreState();
863+
}
860864
if (isTagged) {
861865
canvas.closeTag();
862866
}

0 commit comments

Comments
 (0)