Fix mouse position on Web to match canvas coordinates, not entire window

This commit is contained in:
2026-02-22 22:05:13 +01:00
parent 9fc31b1021
commit 4ca10c7869
+4
View File
@@ -154,6 +154,10 @@ SDLWindow::SDLWindow(const CreateWindowSettings& settings)
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_MENU_BOOLEAN, true);
if (_settings.Parent != nullptr)
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, _settings.Parent->_window);
#if PLATFORM_WEB
SDL_SetStringProperty(props, "SDL.window.create.emscripten.canvas_id", WEB_CANVAS_ID);
SDL_SetStringProperty(props, "SDL.window.create.emscripten.keyboard_element", WEB_CANVAS_ID);
#endif
_window = SDL_CreateWindowWithProperties(props);
SDL_DestroyProperties(props);