diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-17 15:47:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-17 15:57:16 +0300 |
commit | 7785a9c9d2a597a163ef085d94602a1b3aa94d70 (patch) | |
tree | 38836777f3bd707ef2eb16cec615ff2bc7ea2ca7 /source/blender/blenlib/intern/rct.c | |
parent | 1e1c39fc89395c5e5a68a7a21500195cd8dc6fd5 (diff) |
BLI_rect: add a float version of the 'pad' function
Diffstat (limited to 'source/blender/blenlib/intern/rct.c')
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index bec5f0ab3ba..66b7a821eca 100644 --- a/source/blender/blenlib/intern/rct.c +++ b/source/blender/blenlib/intern/rct.c @@ -651,6 +651,14 @@ void BLI_rcti_pad(rcti *rect, int pad_x, int pad_y) rect->ymax += pad_y; } +void BLI_rctf_pad(rctf *rect, float pad_x, float pad_y) +{ + rect->xmin -= pad_x; + rect->ymin -= pad_y; + rect->xmax += pad_x; + rect->ymax += pad_y; +} + void BLI_rctf_resize_x(rctf *rect, float x) { rect->xmin = BLI_rctf_cent_x(rect) - (x * 0.5f); |