Fix T46465: Lag scrubbing w/ PlayAnim

This commit is contained in:
Campbell Barton 2015-10-15 17:25:43 +11:00
parent b4b2caffd8
commit 0be6ca0b83
Notes: blender-bot 2023-02-14 08:32:23 +01:00
Referenced by issue #46465, Blender Player stutters when navigating rendered image sequence
1 changed files with 13 additions and 0 deletions

View File

@ -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);