From cdb046ac3f8df9a6adf3844f5e420709da46527e Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 17 Apr 2026 19:19:21 +0200 Subject: [PATCH] Demo: Assets Browser: fixed not submitting anything after a SetCursorScreenPos() call when no items. Would not manifest because BeginMultiSelect() altered CursorMaxPos. (#5548) cc: 2819ab32f8, edcd5b113e1 --- imgui.cpp | 3 ++- imgui_demo.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 836ba0cc8..188b53d45 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10839,7 +10839,8 @@ bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, si // to extend contents size of our parent container (e.g. window contents size, which is used for auto-resizing // windows, table column contents size used for auto-resizing columns, group size). // This was causing issues and ambiguities and we needed to retire that. -// From 1.89, extending contents size boundaries REQUIRES AN ITEM TO BE SUBMITTED. +// 2022/08/05 (1.89): extending contents size boundaries REQUIRES AN ITEM TO BE SUBMITTED. However we gated the new logic behind a '#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS' block. +// 2025/06/25 (1.92): removed the legacy path and turned into an assert. It was a mistake that there was a #ifndef before: our obsolescence schedule gets pushed back a bit more :( // // Previously this would make the window content size ~200x200: // Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + End(); // NOT OK ANYMORE diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 338a55cb3..08924ea9e 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -11016,6 +11016,8 @@ struct ExampleAssetsBrowser } } clipper.End(); + if (Items.Size == 0) + ImGui::Dummy(ImVec2(0, 0)); ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing // Context menu