diff options
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); |