Browse Source

BeginChild/Tables: Fixed BeginChild temporary activation id collision. Fixes regression in 1.89.6 leading to the first column of tables with either ScrollX or ScrollY flags from being impossible to resize. (#6503)

ocornut 2 years ago
parent
commit
4fab72b40e
3 changed files with 7 additions and 2 deletions
  1. 5 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui.cpp
  3. 1 1
      imgui.h

+ 5 - 0
docs/CHANGELOG.txt

@@ -34,6 +34,11 @@ HOW TO UPDATE?
  VERSION 1.89.7 WIP (In Progress)
 -----------------------------------------------------------------------
 
+Other changes:
+
+- Tables: Fixed a regression in 1.89.6 leading to the first column of tables with either
+  ScrollX or ScrollY flags from being impossible to resize. (#6503)
+
 
 -----------------------------------------------------------------------
  VERSION 1.89.6 (Released 2023-05-31)

+ 1 - 1
imgui.cpp

@@ -5322,7 +5322,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
 
     // Process navigation-in immediately so NavInit can run on first frame
     // Can enter a child if (A) it has navigatable items or (B) it can be scrolled.
-    const ImGuiID temp_id_for_activation = (id + 1);
+    const ImGuiID temp_id_for_activation = ImHashStr("##Child", 0, id);
     if (g.ActiveId == temp_id_for_activation)
         ClearActiveID();
     if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY))

+ 1 - 1
imgui.h

@@ -23,7 +23,7 @@
 // Library Version
 // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
 #define IMGUI_VERSION       "1.89.7 WIP"
-#define IMGUI_VERSION_NUM   18961
+#define IMGUI_VERSION_NUM   18962
 #define IMGUI_HAS_TABLE
 
 /*