File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
layout/src/main/java/com/itextpdf/layout/renderer Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -852,11 +852,15 @@ public void drawBackground(DrawContext drawContext) {
852
852
if (isTagged ) {
853
853
canvas .openTag (new CanvasArtifact ());
854
854
}
855
+ boolean backgroundAreaIsClipped = clipBackgroundArea (drawContext , backgroundArea );
855
856
canvas .saveState ().setFillColor (background .getColor ());
856
857
canvas .rectangle (leftBBoxX - background .getExtraLeft (), bottomBBoxY + (float ) textRise - background .getExtraBottom (),
857
858
backgroundArea .getWidth () + background .getExtraLeft () + background .getExtraRight (),
858
859
backgroundArea .getHeight () - (float ) textRise + background .getExtraTop () + background .getExtraBottom ());
859
860
canvas .fill ().restoreState ();
861
+ if (backgroundAreaIsClipped ) {
862
+ drawContext .getCanvas ().restoreState ();
863
+ }
860
864
if (isTagged ) {
861
865
canvas .closeTag ();
862
866
}
You can’t perform that action at this time.
0 commit comments