1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-12 10:11:00 +01:00

IO: ImGuiConfigFlags_NoMouse disable hovering so it is not destructive. Amend 2464e62a1a

This commit is contained in:
omar 2018-04-06 23:05:53 +02:00
parent e88fb10d7c
commit 0734a12d25

View File

@ -3294,11 +3294,6 @@ static void ImGui::NewFrameUpdateMovingWindow()
static void ImGui::NewFrameUpdateMouseInputs()
{
ImGuiContext& g = *GImGui;
if (g.IO.ConfigFlags & ImGuiConfigFlags_NoMouse)
{
g.IO.MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
memset(g.IO.MouseDown, 0, sizeof(g.IO.MouseDown));
}
// If mouse just appeared or disappeared (usually denoted by -FLT_MAX component, but in reality we test for -256000.0f) we cancel out movement in MouseDelta
if (ImGui::IsMousePosValid(&g.IO.MousePos) && ImGui::IsMousePosValid(&g.IO.MousePosPrev))
@ -3362,6 +3357,10 @@ void ImGui::NewFrameUpdateHoveredWindowAndCaptureFlags()
if (g.HoveredRootWindow && !IsWindowChildOf(g.HoveredRootWindow, modal_window))
g.HoveredRootWindow = g.HoveredWindow = NULL;
// Disabled mouse?
if (g.IO.ConfigFlags & ImGuiConfigFlags_NoMouse)
g.HoveredWindow = g.HoveredRootWindow = NULL;
// We track click ownership. When clicked outside of a window the click is owned by the application and won't report hovering nor request capture even while dragging over our windows afterward.
int mouse_earliest_button_down = -1;
bool mouse_any_down = false;