From e6aa4647573fc97a78ebc84bae426b18db139384 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Oct 2015 00:03:29 +1100 Subject: BLI_rect: add BLI_rctf_clamp Clamp one rect within another. This is done inline in the UI code, which gets verbose. --- source/blender/blenlib/BLI_rect.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenlib/BLI_rect.h') diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index a98931d2ae8..59bf3644912 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -66,6 +66,8 @@ void BLI_rctf_interp(struct rctf *rect, const struct rctf *rect_a, const struct //void BLI_rcti_interp(struct rctf *rect, struct rctf *rect_a, struct rctf *rect_b, float fac); bool BLI_rctf_clamp_pt_v(const struct rctf *rect, float xy[2]); bool BLI_rcti_clamp_pt_v(const struct rcti *rect, int xy[2]); +bool BLI_rctf_clamp(struct rctf *rect, const struct rctf *rect_bounds, float r_xy[2]); +bool BLI_rcti_clamp(struct rcti *rect, const struct rcti *rect_bounds, int r_xy[2]); bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit); bool BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b); bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest); -- cgit v1.2.3