CI / test (push) Failing after 18s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hiNfjrw2edja7LiRLB
1.1 KiB
1.1 KiB
nanosvg
nanosvg (zlib licence, LICENSE.txt), used by the MoonBit
host (wasmhost/bin/raster_stub.c) to draw SVG icons. Upstream draws neither clip paths nor
masks: it drew their shapes, so many icon themes' icons came out with black boxes. Local changes
to nanosvg.h, all marked "Chandra":
- The shapes of a
<clipPath>or<mask>are kept, flaggedNSVG_FLAGS_CLIP(andNSVG_FLAGS_MASK) with the clip's id inclipOf, and never drawn. A shape underclip-path/masknames its clip inclipId. nsvg__placeClipsmoves each clip into the user space of the element using it.- The content of
<symbol>,<pattern>,<marker>and<filter>is skipped; a shape underfilter="url(...)"is flaggedNSVG_FLAGS_FILTERED.
nanosvgrast.h is unchanged: render_svg in raster_stub.c draws runs of shapes and cuts
each to its clip's coverage (a mask's by luminance times alpha). On 370 icons from the Adwaita,
hicolor, Humanity and ubuntu-mono themes this matches resvg's rendering to within
anti-aliasing, except for a few icons that use luminance masks with filters.