[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24320] branches/sculpt25/source/blender/ editors/sculpt_paint/paint_stroke.c: Sculpt: fix bug where mouse release event was not caught in some cases.

Brecht Van Lommel brecht at blender.org
Wed Nov 4 21:15:17 CET 2009


Revision: 24320
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24320
Author:   blendix
Date:     2009-11-04 21:15:17 +0100 (Wed, 04 Nov 2009)

Log Message:
-----------
Sculpt: fix bug where mouse release event was not caught in some cases.

Modified Paths:
--------------
    branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c

Modified: branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c	2009-11-04 20:12:27 UTC (rev 24319)
+++ branches/sculpt25/source/blender/editors/sculpt_paint/paint_stroke.c	2009-11-04 20:15:17 UTC (rev 24320)
@@ -257,8 +257,20 @@
 		//ED_region_tag_redraw(ar);
 	}
 
-	/* TODO: fix hardcoded event here */
-	if(first || event->type == MOUSEMOVE || (event->type == TIMER && (event->customdata == stroke->timer))) {
+	/* TODO: fix hardcoded events here */
+	if(event->type == LEFTMOUSE && event->val == KM_RELEASE) {
+		/* exit stroke, free data */
+		if(stroke->smooth_stroke_cursor)
+			WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor);
+
+		if(stroke->timer)
+			WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer);
+
+		stroke->done(C, stroke);
+		MEM_freeN(stroke);
+		return OPERATOR_FINISHED;
+	}
+	else if(first || event->type == MOUSEMOVE || (event->type == TIMER && (event->customdata == stroke->timer))) {
 		if(stroke->stroke_started) {
 			if(paint_smooth_stroke(stroke, mouse, event)) {
 				if(paint_space_stroke_enabled(stroke->brush)) {
@@ -272,19 +284,7 @@
 				;//ED_region_tag_redraw(ar);
 		}
 	}
-	else if(event->type == LEFTMOUSE && event->val == KM_RELEASE) {
-		/* exit stroke, free data */
-		if(stroke->smooth_stroke_cursor)
-			WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor);
 
-		if(stroke->timer)
-			WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), stroke->timer);
-
-		stroke->done(C, stroke);
-		MEM_freeN(stroke);
-		return OPERATOR_FINISHED;
-	}
-
 	return OPERATOR_RUNNING_MODAL;
 }
 





More information about the Bf-blender-cvs mailing list