mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-19 06:26:35 +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))
|
||||
{
|
||||
ImVec2 mouse_ref = (flags & ImGuiWindowFlags_Tooltip) ? g.IO.MousePos : g.CurrentPopupStack.back().OpenMousePos;
|
||||
if (window->Appearing || (flags & ImGuiWindowFlags_Tooltip))
|
||||
window->ViewportAllowPlatformMonitorExtend = FindPlatformMonitorForPos((use_mouse_ref && IsMousePosValid(&mouse_ref)) ? mouse_ref : NavCalcPreferredRefPos());
|
||||
bool mouse_valid = IsMousePosValid(&mouse_ref);
|
||||
if ((window->Appearing || (flags & ImGuiWindowFlags_Tooltip)) && (!use_mouse_ref || mouse_valid))
|
||||
window->ViewportAllowPlatformMonitorExtend = FindPlatformMonitorForPos((use_mouse_ref && mouse_valid) ? mouse_ref : NavCalcPreferredRefPos());
|
||||
else
|
||||
window->ViewportAllowPlatformMonitorExtend = window->Viewport->PlatformMonitor;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user