diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-10-15 09:25:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-10-15 09:25:43 +0300 |
commit | 0be6ca0b839ffc28d02b9e1bd50cdd81df3b6aeb (patch) | |
tree | d8bc636497768ca15ace8dad61640ac7c783362d /source/blender/windowmanager/intern/wm_playanim.c | |
parent | b4b2caffd8852fa831c4160c2fb6dec23e416c74 (diff) |
Fix T46465: Lag scrubbing w/ PlayAnim
Diffstat (limited to 'source/blender/windowmanager/intern/wm_playanim.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 27b46099edb..5e223144530 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); |