From a63d329261b552126f1bae67ef175bb9a7e0cd90 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 7 Jan 2023 16:05:24 -0700 Subject: [PATCH] [paint-extents] Simplify transform_extents --- src/hb-paint-extents.hh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/hb-paint-extents.hh b/src/hb-paint-extents.hh index 54fd4f51a..814dabfe9 100644 --- a/src/hb-paint-extents.hh +++ b/src/hb-paint-extents.hh @@ -130,18 +130,11 @@ typedef struct hb_transform_t quad_x[3] = extents.xmax; quad_y[3] = extents.ymax; + extents = hb_extents_t {}; for (unsigned i = 0; i < 4; i++) - transform_point (quad_x[i], quad_y[i]); - - extents.xmin = extents.xmax = quad_x[0]; - extents.ymin = extents.ymax = quad_y[0]; - - for (unsigned i = 1; i < 4; i++) { - extents.xmin = hb_min (extents.xmin, quad_x[i]); - extents.ymin = hb_min (extents.ymin, quad_y[i]); - extents.xmax = hb_max (extents.xmax, quad_x[i]); - extents.ymax = hb_max (extents.ymax, quad_y[i]); + transform_point (quad_x[i], quad_y[i]); + extents.add_point (quad_x[i], quad_y[i]); } }