From 6f7da2f9f288ac20e5e7fdcb6aa5fefdd9571059 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 16 Jul 2016 10:50:14 +0200 Subject: [PATCH] Popup: Fixed popup initial frame reading MousePos again instead of the value already stored within the CurrentPopupStack in the previous frame. Doesn't make a big difference here, but will do as gamepad/keyboard navigation will set its own popup position. (#323) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index e2952a280..b80a6999b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3937,7 +3937,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us // Popup first latch mouse position, will position itself when it appears next frame window->AutoPosLastDirection = -1; if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api) - window->PosFloat = g.IO.MousePos; + window->PosFloat = g.CurrentPopupStack.back().MousePosOnOpen; } // Collapse window by double-clicking on title bar