Game asset processing3 min read

SVG icon hole disappeared? Inspect the compound path fill rule

Reproduce a filled icon cutout with two same-direction contours and check the path, style and raster preview separately.

SVG icon hole disappeared? Inspect the compound path fill rule
Two teal emblem plates, one with a diamond cutout and one with a solid center
Concept illustration

A badge can look punched out in the design file but solid in the exported SVG. Check whether the two outlines are subpaths of a single path. This test isolates a compound fill from masks and separate painted shapes.

Use two contours with the same direction

  1. Place a path with data M10 10 H110 V110 H10 Z M35 35 H85 V85 H35 Z on a 120-by-120 SVG canvas. Both rectangles run in the same direction.
  2. Make two copies with the same single-color fill. Set fill-rule to nonzero on one and evenodd on the other. Put each over a checkerboard. With these outlines, the first center stays filled while the second shows the checkerboard through it.
  3. Inspect the exported attribute and the computed style in the target viewer. A removed evenodd setting can expose the default nonzero rule. As a control, reverse the inner contour: its winding now cancels the outer one in the center under nonzero.

Test the delivered files

Check the exported SVG and a raster preview. If an exporter split the hole into a separate filled path, a fill rule on that path cannot cut through another shape below it. Use Resource Compressor for related raster assets, retain the SVG source and verify that the PNG cutout lets both light and dark backgrounds show through.

Ready to try "SVG icon hole disappeared? Inspect the compound path fill rule"?

Use our online tools to apply this tutorial to your indie game project right away.