From d7f9199da282939d3119dd6c7468404ce3b54994 Mon Sep 17 00:00:00 2001 From: ohlidalp Date: Wed, 29 Jan 2025 19:00:04 +0100 Subject: [PATCH] Fixes #3216 - Airplane dashboard not reacting to mouse _problem: _ wrong viewport dimensions used when calculating relative mouse position to query for overlay element. Broken in #3184. Before that, we queried both mouse position and viewport dimensions directly from OIS. I had to change that because of OIS bug, and now the dimension values are not updated correctly. _solution:_ Minimum viable fix - just keep the same dummy OIS event, just update the viewport dimensions. --- source/main/utils/InputEngine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/main/utils/InputEngine.cpp b/source/main/utils/InputEngine.cpp index bf4a5e47ba..5f7777fa87 100644 --- a/source/main/utils/InputEngine.cpp +++ b/source/main/utils/InputEngine.cpp @@ -609,6 +609,10 @@ OIS::MouseState InputEngine::getMouseState() // See commentary in `resetKeysAndMouseButtons()` // To work around, we keep internal button states and pay attention not to get them polluted by OIS. // ----------------------------------------------------------------------------------------------------- + + mouseState.width = (int)App::GetAppContext()->GetRenderWindow()->getWidth(); + mouseState.height = (int)App::GetAppContext()->GetRenderWindow()->getHeight(); + return mouseState; }