Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-06-07 01:43:52 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-07 01:43:52 +0400
commit9b5be450d8aa635d5e1d0b82ea8331da66a87cbf (patch)
tree3adb5cc1f86ee9e0c38ea7cd2f2f228aa26f9a3a /source/blender/blenlib
parent5ed9ede71cd6bc779dc2fb58a83d11b8093978e8 (diff)
text rendering: shadow offset was causing text to clip, now check for clipping without the shadow since not-drawing characters because of subtle effect is rather annoying.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_rect.h4
-rw-r--r--source/blender/blenlib/intern/rct.c19
2 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index ac0ae22c656..f8b9088fe3d 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -74,8 +74,10 @@ bool BLI_rctf_isect_pt(const struct rctf *rect, const float x, const float y);
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2]);
bool BLI_rcti_isect_segment(const struct rcti *rect, const int s1[2], const int s2[2]);
bool BLI_rctf_isect_segment(const struct rctf *rect, const float s1[2], const float s2[2]);
-void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
+bool BLI_rcti_inside_rcti(rcti *rct_a, const rcti *rct_b);
+bool BLI_rctf_inside_rctf(rctf *rct_a, const rctf *rct_b);
void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2);
+void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 91fcb5a5b83..02525e25dda 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -101,6 +101,25 @@ bool BLI_rctf_isect_pt_v(const rctf *rect, const float xy[2])
return true;
}
+/**
+ * is \a rct_b inside \a rct_a
+ */
+bool BLI_rctf_inside_rctf(rctf *rct_a, const rctf *rct_b)
+{
+ return ((rct_a->xmin <= rct_b->xmin) &&
+ (rct_a->xmax >= rct_b->xmax) &&
+ (rct_a->ymin <= rct_b->ymin) &&
+ (rct_a->ymax >= rct_b->ymax));
+}
+bool BLI_rcti_inside_rcti(rcti *rct_a, const rcti *rct_b)
+{
+ return ((rct_a->xmin <= rct_b->xmin) &&
+ (rct_a->xmax >= rct_b->xmax) &&
+ (rct_a->ymin <= rct_b->ymin) &&
+ (rct_a->ymax >= rct_b->ymax));
+}
+
+
/* based closely on 'isect_line_line_v2_int', but in modified so corner cases are treated as intersections */
static int isect_segments_i(const int v1[2], const int v2[2], const int v3[2], const int v4[2])
{