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

Can NOT draw many circles!!! #318

Closed
Thanh-Binh opened this issue Mar 19, 2025 · 2 comments
Closed

Can NOT draw many circles!!! #318

Thanh-Binh opened this issue Mar 19, 2025 · 2 comments

Comments

@Thanh-Binh
Copy link

Dear all,
I want to draw many circles in a matrix format like 128 x 128, but it draws correctly only until 21 x 128 circles.
I really do not know why or it is a bug?

Could you please help me?
Thanks and BR Binh.

Here is my code:

            ImGui::Begin();
            auto pos3 = ImGui::GetCursorScreenPos();
            auto numCircleSegments = -1;
            auto circleThickness = 1;
            auto radius2 = 5;
            auto diam2 = 2*radius2;
            auto nrows2 = 22;  // work ONLY until 21

            for (auto y = 0; y < nrows2; ++y)
            {
                int yPos = pos3.y + (y + 1) * diam2;
                for (auto x = 0; x < 128; ++x)
                {
                    int xPos  = pos3.x + (x + 1) * diam2;
                    draw_list1->AddCircle(ImVec2(xPos, yPos), radius2, IM_COL32(124,124,124,IM_F32_TO_INT8_SAT(ImGui::GetStyle().Alpha)),numCircleSegments, circleThickness);
                }
            }
            ImGui::End();
@eXpl0it3r
Copy link
Member

Please use GitHub Discussions, the SFML forum or join Discord to discuss coding problems, so we can keep the issue tracker for problems with the project itself.

for (auto y = 0; y < nrows2; ++y)

Since nrows2 is 22 the outer loop will only count from 0 to 21 and not 128.

@eXpl0it3r eXpl0it3r closed this as not planned Won't fix, can't repro, duplicate, stale Mar 19, 2025
@Thanh-Binh
Copy link
Author

@eXpl0it3r Maybe you do not understand what I mean.
The above code runs uncorrectly <-> I can not draw (22 x 128) circles
By setting nrows2 by any value less than 22, it draws perfectly -> WHY?????

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

No branches or pull requests

2 participants