diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-21 15:27:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-21 15:39:04 +0300 |
commit | fd7352e5a29c8ecfcbacb56e36fefc4428cb9771 (patch) | |
tree | c2edf5a5c309787fbdfdba9bdca4118ef4f600b6 /source/blender/blenlib/intern/rct.c | |
parent | 24607a2940e72de5bae5ac1cb14eee29a3fcb02b (diff) |
Cleanup: use term pad instead of padding
- Use min/max instead of bottom/top
(in keeping with the rest of the BLI_rect API).
- Swap args (was passing in max, min).
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index bf0e92b39fb..99288abb38c 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -643,23 +643,23 @@ void BLI_rctf_scale(rctf *rect, const float scale) rect->ymax = cent_y + size_y_half; } -void BLI_rctf_padding_y(rctf *rect, - const float boundary_height, - const float padding_top, - const float padding_bottom) +void BLI_rctf_pad_y(rctf *rect, + const float boundary_size, + const float pad_min, + const float pad_max) { - BLI_assert(padding_top >= 0.0f); - BLI_assert(padding_bottom >= 0.0f); - BLI_assert(boundary_height > 0.0f); + BLI_assert(pad_max >= 0.0f); + BLI_assert(pad_min >= 0.0f); + BLI_assert(boundary_size > 0.0f); - float total_padding = padding_top + padding_bottom; - if (total_padding == 0.0f) { + float total_pad = pad_max + pad_min; + if (total_pad == 0.0f) { return; } - float total_extend = BLI_rctf_size_y(rect) * total_padding / (boundary_height - total_padding); - rect->ymax += total_extend * (padding_top / total_padding); - rect->ymin -= total_extend * (padding_bottom / total_padding); + float total_extend = BLI_rctf_size_y(rect) * total_pad / (boundary_size - total_pad); + rect->ymax += total_extend * (pad_max / total_pad); + rect->ymin -= total_extend * (pad_min / total_pad); } void BLI_rctf_interp(rctf *rect, const rctf *rect_a, const rctf *rect_b, const float fac) |