1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Simulate a mouse move for restoring the mouse hover state

This commit is contained in:
Mathieu Schroeter 2018-07-27 21:30:54 +02:00
parent 28f69f44b7
commit b4f53f2d82

View File

@ -275,7 +275,15 @@ CButton::TreatEvent (const SDL_Event & event)
pos.x = event.button.x;
pos.y = event.button.y;
if (MouseUp (pos))
return false; // (*)
{
/* Simulate a mouse move in order to restore the mouse hover state. */
SDL_Event ev = {0};
ev.type = SDL_MOUSEMOTION;
ev.motion.x = pos.x;
ev.motion.y = pos.y;
SDL_PushEvent (&ev);
return false;
} // (*)
break;
}