diff options
author | Hans Goudey <h.goudey@me.com> | 2021-10-04 02:54:52 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-04 02:54:52 +0300 |
commit | b6195f66643be6604a4dc1072ead53d1567f6795 (patch) | |
tree | 1d0e49ead55e26fc5993c6512ac180d288483b9e /source/blender/editors/interface | |
parent | 272a38e0c264911d6ebafcb440432d20c1495604 (diff) |
Cleanup: Replace macro with function
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index ebebf69bc11..e9404b0273d 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -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; } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index f0e3464a955..6ee563003ef 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7587,7 +7587,7 @@ static int ui_do_but_CURVEPROFILE( dist_min_sq = square_f(U.dpi_fac * 8.0f); /* 8 pixel radius from each table point. */ /* Loop through the path's high resolution table and find what's near the click. */ - for (int i = 1; i <= PROF_TABLE_LEN(profile->path_len); i++) { + for (int i = 1; i <= BKE_curveprofile_table_size(profile); i++) { copy_v2_v2(f_xy_prev, f_xy); BLI_rctf_transform_pt_v(&but->rect, &profile->view_rect, f_xy, &table[i].x); |