[rcore] fic position on mouse leave for emscripten. Issue raysan5#5945 followup (#5981)
This commit is contained in:
parent
93e64f2210
commit
89b4fbd298
1 changed files with 10 additions and 2 deletions
|
|
@ -1507,8 +1507,16 @@ static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent
|
||||||
{
|
{
|
||||||
switch (eventType)
|
switch (eventType)
|
||||||
{
|
{
|
||||||
case EMSCRIPTEN_EVENT_MOUSEENTER: CORE.Input.Mouse.cursorOnScreen = true; break;
|
case EMSCRIPTEN_EVENT_MOUSEENTER: {
|
||||||
case EMSCRIPTEN_EVENT_MOUSELEAVE: CORE.Input.Mouse.cursorOnScreen = false; break;
|
// NOTE: Mouse position updated by EmscriptenMouseMoveCallback(),
|
||||||
|
// EmscriptenPointerlockCallback(), and EmscriptenTouchCallback()
|
||||||
|
CORE.Input.Mouse.cursorOnScreen = true;
|
||||||
|
} break;
|
||||||
|
case EMSCRIPTEN_EVENT_MOUSELEAVE:
|
||||||
|
{
|
||||||
|
CORE.Input.Mouse.cursorOnScreen = false;
|
||||||
|
CORE.Input.Mouse.currentPosition = (Vector2){ 0 };
|
||||||
|
} break;
|
||||||
case EMSCRIPTEN_EVENT_MOUSEDOWN:
|
case EMSCRIPTEN_EVENT_MOUSEDOWN:
|
||||||
{
|
{
|
||||||
// NOTE: Emscripten and raylib buttons indices are not aligned
|
// NOTE: Emscripten and raylib buttons indices are not aligned
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue