From 6f1dd7a6880cc246747f47e1d7dc471c859cd117 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 9 Jun 2015 12:32:19 -0600 Subject: [PATCH] Allow Set*WindowSize() calls to be used with popups (fix for using e.g. scroll function on the first frame) --- imgui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index abc421e5..8f5200f9 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3573,7 +3573,9 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_ if ((flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip)) != 0 && !window_was_visible) { window->HiddenFrames = 1; - window->Size = window->SizeFull = window->SizeContents = ImVec2(0.f, 0.f); // TODO: We don't support SetNextWindowSize() for tooltips or popups yet + if (!window_size_set_by_api) + window->Size = window->SizeFull = ImVec2(0.f, 0.f); + window->SizeContents = ImVec2(0.f, 0.f); } // Calculate auto-fit size