diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-02-07 18:38:21 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-02-07 18:38:21 +0300 |
commit | c9ebd5fc16a33669dd8b8cc74b52298616ec42f1 (patch) | |
tree | d946506b362c155be5e26e38e11f210cffbf5a02 /source/blender/blenkernel/intern/tracking_detect.c | |
parent | 2a84bfccdd5d92876a0704b4553255f33a31a3a3 (diff) | |
parent | c0146170af9175120b06416364e021ddbb5f4771 (diff) |
Merge branch 'greasepencil-object' into greasepencil-refactor
Conflicts:
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_detect.c')
-rw-r--r-- | source/blender/blenkernel/intern/tracking_detect.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/tracking_detect.c b/source/blender/blenkernel/intern/tracking_detect.c index ec044f14fa8..08719161e1a 100644 --- a/source/blender/blenkernel/intern/tracking_detect.c +++ b/source/blender/blenkernel/intern/tracking_detect.c @@ -38,7 +38,6 @@ /* Check whether point is inside grease pencil stroke. */ static bool check_point_in_stroke(bGPDstroke *stroke, float x, float y) { - int i, prev; int count = 0; bGPDspoint *points = stroke->points; @@ -50,9 +49,7 @@ static bool check_point_in_stroke(bGPDstroke *stroke, float x, float y) * work, but such situation is crappy anyway. */ - prev = stroke->totpoints - 1; - - for (i = 0; i < stroke->totpoints; i++) { + for (int i = 0, prev = stroke->totpoints - 1; i < stroke->totpoints; prev = i, i++) { if ((points[i].y < y && points[prev].y >= y) || (points[prev].y < y && points[i].y >= y)) { float fac = (y - points[i].y) / (points[prev].y - points[i].y); @@ -60,8 +57,6 @@ static bool check_point_in_stroke(bGPDstroke *stroke, float x, float y) count++; } } - - prev = i; } return (count % 2) ? true : false; |