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

SetScrollHereY will get flicker when style is xx.xxxxx float like #8209

Closed
llxiaoyuan opened this issue Dec 4, 2024 · 2 comments
Closed

Comments

@llxiaoyuan
Copy link

Version/Branch of Dear ImGui:

Version 1.XX, Branch: XXX (master/docking/etc.)

Back-ends:

imgui_impl_XXX.cpp + imgui_impl_XXX.cpp

Compiler, OS:

win10

Full config/build information:

No response

Details:

My Issue/Question:

It takes at least three clicks,to SetScrollHereY in good pos

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

        static bool need_to_set_scroll = false;
        ImGui::Begin(u8"chat111");
        if (ImGui::Button("track_once111"))
        {
            need_to_set_scroll = true;
        }
        ImGui::BeginChild("chatBeginChild1", ImVec2(0, 0), ImGuiChildFlags_Border);
        ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(9.465649, 9.465649));
        ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(9.465649, 13.146734));
        ImGui::BeginChild("chatBeginChild", ImVec2(0, 0), ImGuiChildFlags_Border);
        int scroll_index = 49;
        for (size_t j = 0; j < 50; j++)
        {
            ImGui::TextColored(ImVec4(1, 1, 1, 1), "%d %d",  j, scroll_index);
            if (need_to_set_scroll && scroll_index == j) {
                need_to_set_scroll = false;
                ImGui::SetScrollHereY(0.5f);
            }
        }
        ImGui::EndChild();
        ImGui::PopStyleVar();
        ImGui::PopStyleVar();
        ImGui::EndChild();
        ImGui::End();
@ocornut
Copy link
Owner

ocornut commented Dec 4, 2024

Non integer style values are not supported.

Repository owner deleted a comment from yuvashrikarunakaran Dec 9, 2024
@ocornut
Copy link
Owner

ocornut commented Dec 9, 2024

I have confirmed that the issue doesn't happen with integer values. On your other issue I will move to #8212.

@ocornut ocornut closed this as completed Dec 9, 2024
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