diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-28 03:41:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-28 03:41:01 +0400 |
commit | a2e10608626a9b3bd8a17cf4264a54ce2f03ed6f (patch) | |
tree | d6635e2f0d3f83608097bda46d12d4d3cc57812b /source/blender/editors/interface | |
parent | 1ca7c2e4f3b8dd224782f5c05333fd327d7bc3b3 (diff) |
quiet some warnings and logical errors.
- curve map insert point had a nested loop which used the same value to index different arrays.
- dynamic paint used ternary operator where both outcomes were the same.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index cd3243bb9dc..c24d07f73b9 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3795,6 +3795,8 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt } if (sel == -1) { + int i; + /* if the click didn't select anything, check if it's clicked on the * curve itself, and if so, add a point */ fx= ((float)mx - but->x1)/zoomx + offsx; @@ -3804,8 +3806,10 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt /* loop through the curve segment table and find what's near the mouse. * 0.05 is kinda arbitrary, but seems to be what works nicely. */ - for(a=0; a<=CM_TABLE; a++) { - if ( ( fabs(fx - cmp[a].x) < (0.05) ) && ( fabs(fy - cmp[a].y) < (0.05) ) ) { + for(i=0; i<=CM_TABLE; i++) { + if ( (fabsf(fx - cmp[i].x) < 0.05f) && + (fabsf(fy - cmp[i].y) < 0.05f)) + { curvemap_insert(cuma, fx, fy); curvemapping_changed(cumap, 0); |