Skip to content

Commit 43c51eb

Browse files
committed
Tables: fixed SetNextWindowScroll() value being ignored by BeginTable() during the first frame or when scrolling flags have changed. (ocornut#8196)
1 parent ee2119d commit 43c51eb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Other changes:
5656

5757
- Error Handling: fixed cases where recoverable error handling would crash when
5858
processing errors outside of the NewFrame()..EndFrame() scope. (#1651)
59+
- Tables: fixed SetNextWindowScroll() value being ignored by BeginTable() during
60+
the first frame or when scrolling flags have changed. (#8196)
5961
- Misc: changed embedded ProggyClean encoding to save a bit of binary space (~12kb to 9.5kb).
6062
- Misc: added IMGUI_DISABLE_DEFAULT_FONT to strip embedded font from binary. (#8161)
6163
[@demonese]

imgui_tables.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
410410

411411
// Reset scroll if we are reactivating it
412412
if ((previous_flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) == 0)
413-
SetNextWindowScroll(ImVec2(0.0f, 0.0f));
413+
if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasScroll) == 0)
414+
SetNextWindowScroll(ImVec2(0.0f, 0.0f));
414415

415416
// Create scrolling region (without border and zero window padding)
416417
ImGuiWindowFlags child_window_flags = (flags & ImGuiTableFlags_ScrollX) ? ImGuiWindowFlags_HorizontalScrollbar : ImGuiWindowFlags_None;

0 commit comments

Comments
 (0)