17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-21 02:37:28 +02:00

fix(editor): a touchpad swipe going on past the edge of the window no longer throws the camera away

With the cursor out of the window ImGui has no place for it, and the ray
under it came out as NaN: the zoom put the camera there for good and the
next look at the ground under the cursor aborted. The wheel is left
alone then, and the ground isn't asked for a point which isn't one. The
self-test gets leave, the cursor taken out of the window.
This commit is contained in:
maj00r
2026-10-19 20:02:03 +02:00
parent 90ce10960e
commit 33892c1936
2 changed files with 11 additions and 1 deletions

View File

@@ -93,6 +93,13 @@ bool scripted_input::dispatch(std::string const &Command, std::istringstream &Wo
WriteLog(format("SELFTEST mouse %.0f %.0f", screen.x, screen.y));
return true;
}
if (Command == "leave")
{
m_mouse.reset();
queue([]() { ui_layer::cursor_enter_callback(0); });
WriteLog("SELFTEST leave");
return true;
}
if (Command == "button")
{
std::string which;