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>2015-10-17 10:52:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-17 10:52:05 +0300
commit2927fa4450a9bb8341e11eb6d61773d778b8c390 (patch)
tree16dae00fca727647afd6cd474c46f4fbf9812668
parent88767a193980ff10ac4c5c4241d7c089823294a9 (diff)
correct own error in rectangle clamping
-rw-r--r--source/blender/blenlib/intern/rct.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 600ae6b4fab..a5f7fe2a008 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -508,8 +508,8 @@ bool BLI_rctf_clamp(rctf *rect, const rctf *rect_bounds, float r_xy[2])
if (rect->xmin < rect_bounds->xmin) {
float ofs = rect_bounds->xmin - rect->xmin;
- rect->xmin += r_xy[0];
- rect->xmax += r_xy[0];
+ rect->xmin += ofs;
+ rect->xmax += ofs;
r_xy[0] += ofs;
changed = true;
}
@@ -524,8 +524,8 @@ bool BLI_rctf_clamp(rctf *rect, const rctf *rect_bounds, float r_xy[2])
if (rect->ymin < rect_bounds->ymin) {
float ofs = rect_bounds->ymin - rect->ymin;
- rect->ymin += r_xy[1];
- rect->ymax += r_xy[1];
+ rect->ymin += ofs;
+ rect->ymax += ofs;
r_xy[1] += ofs;
changed = true;
}
@@ -550,8 +550,8 @@ bool BLI_rcti_clamp(rcti *rect, const rcti *rect_bounds, int r_xy[2])
if (rect->xmin < rect_bounds->xmin) {
int ofs = rect_bounds->xmin - rect->xmin;
- rect->xmin += r_xy[0];
- rect->xmax += r_xy[0];
+ rect->xmin += ofs;
+ rect->xmax += ofs;
r_xy[0] += ofs;
changed = true;
}
@@ -566,8 +566,8 @@ bool BLI_rcti_clamp(rcti *rect, const rcti *rect_bounds, int r_xy[2])
if (rect->ymin < rect_bounds->ymin) {
int ofs = rect_bounds->ymin - rect->ymin;
- rect->ymin += r_xy[1];
- rect->ymax += r_xy[1];
+ rect->ymin += ofs;
+ rect->ymax += ofs;
r_xy[1] += ofs;
changed = true;
}