diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2020-01-14 18:18:41 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2020-01-14 18:30:38 +0300 |
commit | 388d43d85a5d9dfc5261848c91c12dd883ea1f59 (patch) | |
tree | 0dc68b299c2bb95671265514dfebe3e35ecfd096 /source/blender/blenlib/BLI_rect.h | |
parent | 473fc35c70ecf6f64c46be66046cac2a919f633b (diff) |
BLI_rct: Utilities for sanitizing coordinates (ensuring min <= max)
This might be useful in some places. Much of the code makes the implicit
assumption that the rectangle has valid coordinate order, good to make
it more explicit.
Diffstat (limited to 'source/blender/blenlib/BLI_rect.h')
-rw-r--r-- | source/blender/blenlib/BLI_rect.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index e3cd70f7413..fdb4fe30f1c 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -39,6 +39,10 @@ bool BLI_rcti_is_empty(const struct rcti *rect); bool BLI_rctf_is_empty(const struct rctf *rect); void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax); void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax); +bool BLI_rctf_is_valid(const struct rctf *rect); +bool BLI_rcti_is_valid(const struct rcti *rect); +void BLI_rctf_sanitize(struct rctf *rect); +void BLI_rcti_sanitize(struct rcti *rect); void BLI_rctf_init_pt_radius(struct rctf *rect, const float xy[2], float size); void BLI_rcti_init_pt_radius(struct rcti *rect, const int xy[2], int size); void BLI_rcti_init_minmax(struct rcti *rect); |