[Bf-blender-cvs] [3247955] gooseberry: Graph editor uses own function for setting frame, use scrub flag there as well.

Antony Riakiotakis noreply at git.blender.org
Thu Apr 30 17:48:05 CEST 2015


Commit: 3247955492b94c8f340be5cedbba700b92d2a5e5
Author: Antony Riakiotakis
Date:   Thu Apr 30 17:47:56 2015 +0200
Branches: gooseberry
https://developer.blender.org/rB3247955492b94c8f340be5cedbba700b92d2a5e5

Graph editor uses own function for setting frame, use scrub flag there
as well.

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

M	source/blender/editors/space_graph/graph_ops.c

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

diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index e331fcf..9b2a1a2 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -138,12 +138,16 @@ static void graphview_cursor_setprops(bContext *C, wmOperator *op, const wmEvent
 /* Modal Operator init */
 static int graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
+	wmWindow *win = CTX_wm_window(C);
 	/* Change to frame that mouse is over before adding modal handler,
 	 * as user could click on a single frame (jump to frame) as well as
 	 * click-dragging over a range (modal scrubbing).
 	 */
 	graphview_cursor_setprops(C, op, event);
-	
+
+	if (win->screen)
+		win->screen->scrubbing = true;
+
 	/* apply these changes first */
 	graphview_cursor_apply(C, op);
 	
@@ -155,9 +159,13 @@ static int graphview_cursor_invoke(bContext *C, wmOperator *op, const wmEvent *e
 /* Modal event handling of cursor changing */
 static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *event)
 {
+	wmWindow *win = CTX_wm_window(C);
+
 	/* execute the events */
 	switch (event->type) {
 		case ESCKEY:
+			if (win->screen)
+				win->screen->scrubbing = false;
 			return OPERATOR_FINISHED;
 		
 		case MOUSEMOVE:
@@ -172,8 +180,12 @@ static int graphview_cursor_modal(bContext *C, wmOperator *op, const wmEvent *ev
 			/* we check for either mouse-button to end, as checking for ACTIONMOUSE (which is used to init 
 			 * the modal op) doesn't work for some reason
 			 */
-			if (event->val == KM_RELEASE)
+			if (event->val == KM_RELEASE) {
+				if (win->screen)
+					win->screen->scrubbing = false;
+
 				return OPERATOR_FINISHED;
+			}
 			break;
 	}




More information about the Bf-blender-cvs mailing list