From 3b72f1824cf06216c70101ee0d29004cc6dc632d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 5 Sep 2013 20:54:32 +0000 Subject: rename positive_mod to mod_i, make it work with nagative numbers (matching pythons modulo), and use in a few more places. allow mesh-checker-deselect to have a negative offset. --- source/blender/blenkernel/intern/anim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/anim.c') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 3d8b70b693b..49c9a8e9083 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -594,8 +594,7 @@ void calc_curvepath(Object *ob, ListBase *nurbs) static int interval_test(const int min, const int max, int p1, const int cycl) { if (cycl) { - if (p1 < min) p1 = ((p1 - min) % (max - min + 1)) + max + 1; - else if (p1 > max) p1 = ((p1 - min) % (max - min + 1)) + min; + p1 = mod_i(p1 - min, (max - min + 1)) + min; } else { if (p1 < min) p1 = min; -- cgit v1.2.3