[Bf-blender-cvs] [6ab2206] master: Fix for typo comparing double events

Campbell Barton noreply at git.blender.org
Sat Apr 30 08:27:02 CEST 2016


Commit: 6ab22064c2c40af4ae83a87882078d293c9ce928
Author: Campbell Barton
Date:   Sat Apr 30 16:18:29 2016 +1000
Branches: master
https://developer.blender.org/rB6ab22064c2c40af4ae83a87882078d293c9ce928

Fix for typo comparing double events

Also remove doubles when filling the final array.

===================================================================

M	source/blender/editors/curve/editcurve_paint.c

===================================================================

diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index d24c339..f173498 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);
 			}
 		}




More information about the Bf-blender-cvs mailing list