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

The problem of ImGui::Dragfloat3() in for-loop #5884

Closed
Wayne693 opened this issue Nov 15, 2022 · 1 comment
Closed

The problem of ImGui::Dragfloat3() in for-loop #5884

Wayne693 opened this issue Nov 15, 2022 · 1 comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@Wayne693
Copy link

Version/Branch of Dear ImGui:

Version: v1.89
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl2.cpp
Operating System: Windows10

My Issue/Question:

Hi, I'm having an issue after using DragFloat3 in the for-loop. In my soft raster project I have a lot of models, and I want to control the translation, rotation, and scaling of the model through the UI panel, so that I can iterate through all the models with a for-loop and modify the properties of the model through DragFloat3. Unfortunately, there is a bug here, when I drag the properties of model one, the properties corresponding to the other models will also change, and I hope that the operation for them is separate. Now I don't know what's wrong, can you help me?

Screenshots/Video

This is part of my code :
image

@ocornut ocornut added the label/id and id stack implicit identifiers, pushid(), id stack label Nov 15, 2022
@ocornut
Copy link
Owner

ocornut commented Nov 15, 2022

You need to use PushID() / PopID() in for-loops. Read FAQ:
https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-how-can-i-have-multiple-widgets-with-the-same-label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack
Projects
None yet
Development

No branches or pull requests

2 participants