Demo: Assets Browser: fixed not submitting anything after a SetCursorScreenPos() call when no items. Would not manifest because BeginMultiSelect() altered CursorMaxPos. (#5548)

cc: 2819ab32f8, edcd5b113e
This commit is contained in:
ocornut
2026-04-17 19:19:21 +02:00
parent 97939e6837
commit cdb046ac3f
2 changed files with 4 additions and 1 deletions

View File

@@ -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

View File

@@ -11016,6 +11016,8 @@ struct ExampleAssetsBrowser
}
}
clipper.End();
if (Items.Size == 0)
ImGui::Dummy(ImVec2(0, 0));
ImGui::PopStyleVar(); // ImGuiStyleVar_ItemSpacing
// Context menu