Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect scrollbar calculation: plus should be replaced by minus #1574

Closed
mekhontsev opened this issue Jan 26, 2018 · 2 comments
Closed

Incorrect scrollbar calculation: plus should be replaced by minus #1574

mekhontsev opened this issue Jan 26, 2018 · 2 comments

Comments

@mekhontsev
Copy link

imgui/imgui.cpp

Line 4675 in 486f0a8

window->ScrollbarY = (window->SizeContents.y > size_y_for_scrollbars + style.ScrollbarSize) && !(flags & ImGuiWindowFlags_NoScrollbar);

ocornut added a commit that referenced this issue Jan 26, 2018
@ocornut
Copy link
Owner

ocornut commented Jan 26, 2018

Thank you, it looks like a bug introduced in c36e586 (I replaced + ItemSpacing.y - ScrollbarSize by + ScrollbarSize. Fixed now.

It's easy to confirm by resizing this window manually and comparing how the ScrollbarY appears depending on whether ScrollbarX is enabled.

ImGui::Begin("Test #1574", NULL, ImGuiWindowFlags_HorizontalScrollbar);
ImGui::Button("##xxx", ImVec2(500,500));
ImGui::End();

Thank you!

@ocornut ocornut closed this as completed Jan 26, 2018
ocornut added a commit that referenced this issue Jun 3, 2024
… required solely by the presence of an horizontal scrollbar. (#1574)

Initially fixed by 2d9d7a1, and broken back by a0994d7 (v1.71, wow).
ocornut added a commit to ocornut/imgui_test_engine that referenced this issue Jun 3, 2024
@ocornut
Copy link
Owner

ocornut commented Jun 3, 2024

Very surprisingly, this got accidentally broken back in a0994d7 in 2019 during a refactor of another thing (to a lesser extent than the original report).
Fixed again with 6cefd4f.
Added a test ocornut/imgui_test_engine@45c1fbb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants