Cleanup: Replace macro with function

This commit is contained in:
2021-10-03 18:54:52 -05:00
parent 272a38e0c2
commit b6195f6664
5 changed files with 23 additions and 15 deletions

View File

@@ -1860,13 +1860,13 @@ void ui_draw_but_CURVEPROFILE(ARegion *region,
/* Also add the last points on the right and bottom edges to close off the fill polygon. */
const bool add_left_tri = profile->view_rect.xmin < 0.0f;
const bool add_bottom_tri = profile->view_rect.ymin < 0.0f;
uint tot_points = (uint)PROF_TABLE_LEN(profile->path_len) + 1 + add_left_tri + add_bottom_tri;
uint tot_points = (uint)BKE_curveprofile_table_size(profile) + 1 + add_left_tri + add_bottom_tri;
const uint tot_triangles = tot_points - 2;
/* Create array of the positions of the table's points. */
float(*table_coords)[2] = MEM_mallocN(sizeof(*table_coords) * tot_points, "table x coords");
for (uint i = 0; i < (uint)PROF_TABLE_LEN(profile->path_len);
i++) { /* Only add the points from the table here. */
for (uint i = 0; i < (uint)BKE_curveprofile_table_size(profile); i++) {
/* Only add the points from the table here. */
table_coords[i][0] = pts[i].x;
table_coords[i][1] = pts[i].y;
}