Fix SetMouseCursor implementation for PLATFORM_WEB

- Restrict function to only set the cursor inside the canvas
This commit is contained in:
BeardedBread 2023-10-14 22:59:39 +08:00
parent 2498170b95
commit e4a5b04d66

View File

@ -685,8 +685,9 @@ void SetMouseCursor(int cursor)
} break; } break;
} }
// Set the cursor element on the CSS // Set the cursor element on the canvas CSS
EM_ASM({document.body.style.cursor = UTF8ToString($0);}, cursorName); // The canvas is coded to the Id "canvas" on init
EM_ASM({document.getElementById("canvas").style.cursor = UTF8ToString($0);}, cursorName);
} }
// Register all input events // Register all input events