From c3d9f8ee7e7fe6c51b5d580c65627d2732054ce3 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 23 Nov 2022 15:18:59 +0100 Subject: [PATCH] Layout: fixed End()/EndChild() incorrectly asserting if users manipulates cursor position inside a collapsed/culled window and IMGUI_DISABLE_OBSOLETE_FUNCTIONS is enabled. (#5548, #5911) --- docs/CHANGELOG.txt | 2 ++ imgui.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 5827fea49..1dd5df4be 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -38,6 +38,8 @@ HOW TO UPDATE? - Inputs: fixed moving a window or drag and dropping from preventing input-owner-unaware code from accessing keys. (#5888, #4921, #456) - Inputs: fixed moving a window or drag and dropping from capturing mods. (#5888, #4921, #456) +- Layout: fixed End()/EndChild() incorrectly asserting if users manipulates cursor position + inside a collapsed/culled window and IMGUI_DISABLE_OBSOLETE_FUNCTIONS is enabled. (#5548, #5911) - ColorEdit: fixed label overlapping when using style.ColorButtonPosition == ImGuiDir_Left to move the color button on the left side (regression introduced in 1.88 WIP 2022/02/28). (#5912) - Backends: GLFW: cancel out errors emitted by glfwGetKeyName() when a name is missing. (#5908) diff --git a/imgui.cpp b/imgui.cpp index 51a1cf180..0fac87306 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8694,6 +8694,8 @@ void ImGui::ErrorCheckUsingSetCursorPosToExtendParentBoundaries() #ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS if (window->DC.CursorPos.x <= window->DC.CursorMaxPos.x && window->DC.CursorPos.y <= window->DC.CursorMaxPos.y) return; + if (window->SkipItems) + return; IM_ASSERT(0 && "Code uses SetCursorPos()/SetCursorScreenPos() to extend window/parent boundaries. Please submit an item e.g. Dummy() to validate extent."); #else window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);