Commit: 2f1bab75d7e00ad1cda614f535f194e2779421d6
Author: Campbell Barton
Date:   Thu Oct 15 17:25:43 2015 +1100
Branches: blender-v2.76-release
https://developer.blender.org/rB2f1bab75d7e00ad1cda614f535f194e2779421d6

Fix T46465: Lag scrubbing w/ PlayAnim

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

M       source/blender/windowmanager/intern/wm_playanim.c

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

diff --git a/source/blender/windowmanager/intern/wm_playanim.c 
b/source/blender/windowmanager/intern/wm_playanim.c
index 2f7e113..124f2e0 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -973,6 +973,19 @@ static int ghost_event_proc(GHOST_EventHandle evt, 
GHOST_TUserDataPtr ps_void)
                                GHOST_TEventCursorData *cd = 
GHOST_GetEventData(evt);
                                int cx, cy;
 
+                               /* Ignore 'in-between' events, since they can 
make scrubbing lag.
+                                *
+                                * Ideally we would keep into the event queue 
and see if this is the last motion event.
+                                * however the API currently doesn't support 
this. */
+                               {
+                                       int x_test, y_test;
+                                       
GHOST_GetCursorPosition(g_WS.ghost_system, &x_test, &y_test);
+                                       if (x_test != cd->x || y_test != cd->y) 
{
+                                               /* we're not the last event... 
skipping */
+                                               break;
+                                       }
+                               }
+
                                GHOST_ScreenToClient(g_WS.ghost_window, cd->x, 
cd->y, &cx, &cy);
 
                                change_frame(ps, cx);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to