[paint-extents] Simplify transform_extents

This commit is contained in:
Behdad Esfahbod 2023-01-07 16:05:24 -07:00
parent e062f98260
commit a63d329261
1 changed files with 3 additions and 10 deletions

View File

@ -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]);
}
}