diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-04-30 09:18:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-04-30 09:21:06 +0300 |
commit | 6ab22064c2c40af4ae83a87882078d293c9ce928 (patch) | |
tree | b3ad60d91021509e817a9c2cf016c5a15caac6ce | |
parent | ac163447f86f95ec6136991d7df3aaaefdd55fae (diff) |
Fix for typo comparing double events
Also remove doubles when filling the final array.
-rw-r--r-- | source/blender/editors/curve/editcurve_paint.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index d24c33984ee..f17349822c9 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -876,6 +876,12 @@ static int curve_draw_exec(bContext *C, wmOperator *op) if (coords_indices.radius != -1) { co[coords_indices.radius] = selem->pressure; } + + /* remove doubles */ + if ((co != coords) && UNLIKELY(memcmp(co, co - dims, sizeof(float) * dims) == 0)) { + co -= dims; + stroke_len--; + } } } @@ -1173,7 +1179,7 @@ static int curve_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) else if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) { if (cdd->state == CURVE_DRAW_PAINTING) { const float mval_fl[2] = {UNPACK2(event->mval)}; - if (len_squared_v2v2(mval_fl, cdd->prev.location_world) > SQUARE(STROKE_SAMPLE_DIST_MIN_PX)) { + if (len_squared_v2v2(mval_fl, cdd->prev.mouse) > SQUARE(STROKE_SAMPLE_DIST_MIN_PX)) { curve_draw_event_add(op, event); } } |