-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Child window (auto-fit) scrollbar appearing when it should not #7063
Labels
Comments
Thank you, I confirmed this and pushed a fix f37f6f6 Repro was: ImGui::Begin("Bug #7063");
ImGui::BeginChild("blah", ImVec2(0, 0), ImGuiChildFlags_AutoResizeY);
for (int n = 0; n < 1000; n++)
ImGui::Text("...");
ImGui::EndChild();
ImGui::End(); |
ocornut
added a commit
that referenced
this issue
Nov 27, 2023
… to host viewport minus padding. (#7063)
ocornut
added a commit
that referenced
this issue
Feb 20, 2024
ocornut
added a commit
that referenced
this issue
Feb 27, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hello,
I have been using ImGui (docking) for an editor of my game engine and updated to 1.90 for the content auto-fit of child windows.
It seems to work great but I noticed an issue where a scrollbar appeared in both child window and main window, when the child is supposed to grow within the main window.
I made sure to pass ImGuiChildFlags_AutoResizeY.
I actually stepped through it all and narrowed down the reason why the scrollbar appeared.
While debugging I noticed that window->Size/SizeFull were always 2 pixels lower than the content size.
It seems that child windows use the CalcWindowAutoFitSize function, which makes use of style.DisplaySafeAreaPadding.
I assume this style variable is only meant to be applied when it is a real window and not a child window.
Once I set style.DisplaySafeAreaPadding to 0 the scrollbar of the child disappeared.
The specific line of code causing this problem:
imgui/imgui.cpp
Line 5792 in bce4db0
The text was updated successfully, but these errors were encountered: