mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-23 16:16:36 +00:00
Viewport: Fixed an assert on loss of valid mouse position while dragging a tooltip (would happen often when using debugger breakpoint). Not totally sure about best solution, may not be important.
This commit is contained in:
parent
9824bf1ba1
commit
c031ea088a
@ -6923,8 +6923,9 @@ static void ImGui::UpdateSelectWindowViewport(ImGuiWindow* window)
|
|||||||
if (flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup))
|
if (flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup))
|
||||||
{
|
{
|
||||||
ImVec2 mouse_ref = (flags & ImGuiWindowFlags_Tooltip) ? g.IO.MousePos : g.CurrentPopupStack.back().OpenMousePos;
|
ImVec2 mouse_ref = (flags & ImGuiWindowFlags_Tooltip) ? g.IO.MousePos : g.CurrentPopupStack.back().OpenMousePos;
|
||||||
if (window->Appearing || (flags & ImGuiWindowFlags_Tooltip))
|
bool mouse_valid = IsMousePosValid(&mouse_ref);
|
||||||
window->ViewportAllowPlatformMonitorExtend = FindPlatformMonitorForPos((use_mouse_ref && IsMousePosValid(&mouse_ref)) ? mouse_ref : NavCalcPreferredRefPos());
|
if ((window->Appearing || (flags & ImGuiWindowFlags_Tooltip)) && (!use_mouse_ref || mouse_valid))
|
||||||
|
window->ViewportAllowPlatformMonitorExtend = FindPlatformMonitorForPos((use_mouse_ref && mouse_valid) ? mouse_ref : NavCalcPreferredRefPos());
|
||||||
else
|
else
|
||||||
window->ViewportAllowPlatformMonitorExtend = window->Viewport->PlatformMonitor;
|
window->ViewportAllowPlatformMonitorExtend = window->Viewport->PlatformMonitor;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user