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)

This commit is contained in:
ocornut 2016-07-16 10:50:14 +02:00
parent 91e1c56da6
commit 6f7da2f9f2

View File

@ -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 // Popup first latch mouse position, will position itself when it appears next frame
window->AutoPosLastDirection = -1; window->AutoPosLastDirection = -1;
if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api) 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 // Collapse window by double-clicking on title bar