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:
parent
28f69f44b7
commit
b4f53f2d82
@ -275,7 +275,15 @@ CButton::TreatEvent (const SDL_Event & event)
|
|||||||
pos.x = event.button.x;
|
pos.x = event.button.x;
|
||||||
pos.y = event.button.y;
|
pos.y = event.button.y;
|
||||||
if (MouseUp (pos))
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user