From 14c789de8d69d1af93da842a44ca5f8cfd0fc688 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 17 Apr 2026 01:38:12 -0600 Subject: [PATCH] [vector-paint] Don't clear output buffers on changed() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit changed() was clearing defs, path, and group_stack (the accumulated output) in addition to the glyph caches. When set_foreground was called per-glyph (e.g. --rainbow), each color change wiped all previous glyphs — only the last one survived in the rendered output. Only clear the caches (defined_outlines, defined_clips, active_color_glyphs, defined_color_glyphs). Leave the output buffers and counters intact. Assisted-by: Claude Opus 4.6 (1M context) --- src/hb-vector-paint.hh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/hb-vector-paint.hh b/src/hb-vector-paint.hh index b314a45c0..db287eda6 100644 --- a/src/hb-vector-paint.hh +++ b/src/hb-vector-paint.hh @@ -62,14 +62,6 @@ struct hb_vector_paint_t if (active_color_glyphs) hb_set_clear (active_color_glyphs); defined_color_glyphs.reset (); - defs.shrink (0); - path.shrink (0); - for (auto &g : group_stack) - g.shrink (0); - color_glyph_counter = 0; - clip_rect_counter = 0; - clip_path_counter = 0; - gradient_counter = 0; } void check_font (hb_font_t *font)