diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-17 16:27:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-17 16:27:29 +0300 |
commit | 71def9738e477a6d6182c35bb5a7d94baf59b4d9 (patch) | |
tree | a4d94a89756ae94b2a78d7cca0be3eaace5b25ff /source/blender/blenlib | |
parent | 03ad2958d3ecc391105baf6c347031e87fa1f41c (diff) | |
parent | 7785a9c9d2a597a163ef085d94602a1b3aa94d70 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_rect.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/rct.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index 1d742e2c28a..fb52436587f 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -65,6 +65,7 @@ void BLI_rcti_resize(struct rcti *rect, int x, int y); void BLI_rcti_resize_x(struct rcti *rect, int x); void BLI_rcti_resize_y(struct rcti *rect, int y); void BLI_rcti_pad(struct rcti *rect, int pad_x, int pad_y); +void BLI_rctf_pad(struct rctf *rect, float pad_x, float pad_y); void BLI_rctf_resize(struct rctf *rect, float x, float y); void BLI_rctf_resize_x(struct rctf *rect, float x); void BLI_rctf_resize_y(struct rctf *rect, float y); diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c index 61e0ec393cb..35e24ecc785 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); |