From 9817fa9947e73dcdcf592e51591c5d7612e47cb4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 23 Jan 2025 12:20:48 -0700 Subject: [PATCH] [hvgl] Add get_total_num_parts() --- src/hb-aat-var-hvgl-table.hh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/hb-aat-var-hvgl-table.hh b/src/hb-aat-var-hvgl-table.hh index 29009b86e..cdac618b8 100644 --- a/src/hb-aat-var-hvgl-table.hh +++ b/src/hb-aat-var-hvgl-table.hh @@ -95,6 +95,9 @@ struct PartShape unsigned get_total_num_axes () const { return axisCount; } + unsigned get_total_num_parts () const + { return 1; } + HB_INTERNAL void get_path_at (const struct hvgl &hvgl, hb_draw_session_t &draw_session, @@ -354,6 +357,9 @@ struct PartComposite unsigned get_total_num_axes () const { return totalNumAxes; } + unsigned get_total_num_parts () const + { return totalNumParts; } + HB_INTERNAL void get_path_at (const struct hvgl &hvgl, hb_draw_session_t &draw_session, @@ -427,6 +433,15 @@ struct Part } } + unsigned get_total_num_parts () const + { + switch (u.flags & 1) { + case 0: hb_barrier(); return u.shape.get_total_num_parts (); + case 1: hb_barrier(); return u.composite.get_total_num_parts (); + default: return 0; + } + } + void get_path_at (const struct hvgl &hvgl, hb_draw_session_t &draw_session, @@ -588,7 +603,6 @@ struct hvgl hb_vector_t coords_f {+ hb_iter (coords) | hb_map ([] (int x) { return float (x) * (1.f / (1 << 14)); })}; - coords_f.resize (part.get_total_num_axes (), true, true); return get_part_path_at (gid, draw_session, coords_f, transform, visited, edges_left, depth_left);