Skip to content

Commit

Permalink
Tables: fixed SetNextWindowScroll() value being ignored by BeginTable…
Browse files Browse the repository at this point in the history
…() during the first frame or when scrolling flags have changed. (#8196)
  • Loading branch information
ocornut committed Dec 2, 2024
1 parent ee2119d commit 43c51eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Other changes:

- Error Handling: fixed cases where recoverable error handling would crash when
processing errors outside of the NewFrame()..EndFrame() scope. (#1651)
- Tables: fixed SetNextWindowScroll() value being ignored by BeginTable() during
the first frame or when scrolling flags have changed. (#8196)
- Misc: changed embedded ProggyClean encoding to save a bit of binary space (~12kb to 9.5kb).
- Misc: added IMGUI_DISABLE_DEFAULT_FONT to strip embedded font from binary. (#8161)
[@demonese]
Expand Down
3 changes: 2 additions & 1 deletion imgui_tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG

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

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

0 comments on commit 43c51eb

Please sign in to comment.