Skip to content

Commit cbb82b1

Browse files
committed
SVG: element with empty clip-path should not be drawn
DEVSIX-8755
1 parent 8a7f840 commit cbb82b1

File tree

6 files changed

+27
-1
lines changed

6 files changed

+27
-1
lines changed

svg/src/main/java/com/itextpdf/svg/renderers/impl/AbstractSvgNodeRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ private boolean drawInClipPath(SvgDrawContext context) {
589589
SvgNodeRendererInheritanceResolver.applyInheritanceToSubTree(this, clipPath, context.getCssContext());
590590
clipPath.setClippedRenderer(this);
591591
clipPath.draw(context);
592-
return !clipPath.getChildren().isEmpty();
592+
return true;
593593
}
594594
}
595595
return false;

svg/src/test/java/com/itextpdf/svg/renderers/impl/ClipPathSvgNodeRendererIntegrationTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ public static void beforeClass() {
4444
ITextTest.createDestinationFolder(DESTINATION_FOLDER);
4545
}
4646

47+
@Test
48+
public void emptyClipPathTest() throws IOException, InterruptedException {
49+
convertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "emptyClipPath");
50+
}
51+
52+
@Test
53+
public void invalidClipPathTest() throws IOException, InterruptedException {
54+
convertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "invalidClipPath");
55+
}
56+
4757
@Test
4858
public void rectClipPathComplexTest() throws IOException, InterruptedException {
4959
convertAndCompareSinglePage(SOURCE_FOLDER, DESTINATION_FOLDER, "clippath_rect_complex");
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 8 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)