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>2012-08-19 00:54:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-19 00:54:43 +0400
commitab662a1e02299691867c3c4480000d630377ea37 (patch)
tree4903de1b0d3364293346d0c11f86f3724995a3bf /source/blender/blenlib
parent12425588f2d33174e4a78873075b185ea51ebc3d (diff)
fix for own commit r49991, this exposed bad logic in rect copy function.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_rect.h3
-rw-r--r--source/blender/blenlib/intern/rct.c18
2 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index 55ab961cc53..d6579afcd0d 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -69,7 +69,8 @@ int BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rct
int BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest);
void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2);
-void BLI_rcti_rctf_copy(struct rcti *tar, const struct rctf *src);
+void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
+void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
void print_rctf(const char *str, const struct rctf *rect);
void print_rcti(const char *str, const struct rcti *rect);
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index e22becddfd6..9c65c26c72b 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -363,12 +363,20 @@ int BLI_rcti_isect(const rcti *src1, const rcti *src2, rcti *dest)
}
}
-void BLI_rcti_rctf_copy(rcti *tar, const rctf *src)
+void BLI_rcti_rctf_copy(rcti *dst, const rctf *src)
{
- tar->xmin = floorf(src->xmin + 0.5f);
- tar->xmax = floorf((src->xmax - src->xmin) + 0.5f);
- tar->ymin = floorf(src->ymin + 0.5f);
- tar->ymax = floorf((src->ymax - src->ymin) + 0.5f);
+ dst->xmin = floorf(src->xmin + 0.5f);
+ dst->xmax = dst->xmin + floorf((src->xmax - src->xmin) + 0.5f);
+ dst->ymin = floorf(src->ymin + 0.5f);
+ dst->ymax = dst->ymin + floorf((src->ymax - src->ymin) + 0.5f);
+}
+
+void BLI_rctf_rcti_copy(rctf *dst, const rcti *src)
+{
+ dst->xmin = src->xmin;
+ dst->xmax = src->xmax;
+ dst->ymin = src->ymin;
+ dst->ymax = src->ymax;
}
void print_rctf(const char *str, const rctf *rect)