-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Any idea when horizontal scroll bar will be available? #246
Comments
I was actually looking into some of that recently. There's a few problems to take care of, e.g. some clipping optimisations for huge block of texts are skipping on text width calculation. Scrolling is easy and free but calculating accurate size to have a reference point of how big is the contents, can sometimes be costly. |
Note that you can easily hack some form of manual scrolling (without scrollbar) by positioning the cursor. static float x = 0.0f;
if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_LeftArrow)))
x -= ImGui::GetIO().DeltaTime * 1000.0f;
if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_RightArrow)))
x += ImGui::GetIO().DeltaTime * 1000.0f;
ImGui::SetCursorPosX((float)(int)-x);
ImGui::BeginGroup();
... |
Thanks! I ll give it a try. On 20 July 2015 at 03:55, omar [email protected] wrote:
Best Regards |
… just to remove some syntax noise from the following commit (#246)
…ntent width via SetNextWindowContentSize() etc (#246) GetCursorPos, SetCursorPos, GetContentRegionMax, GetWindowContentRegionMin, GetWindowContentRegionMax are now including the scrolling amount. It PROBABLY shouldn't break anything for you, but take note that SetCursorPosX(100.0f) puts you at +100 from the starting x position which may include scrolling, not at +100 from the window left side.
…djust it with scrollbar sizes (#246)
OK pretty much done with that. You can call SetNextWindowContentWidth(width) before Begin() to specify a desired width. |
@ocornut you are amazing... thank you! |
@ocornut WOW!! Thanks! thanks! |
Looks cool. I will upgrade my code tonight :) Thanks a lot |
No description provided.
The text was updated successfully, but these errors were encountered: