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

ImPlot heavily relies on DragLineX call order but it shall not (IMO) #306

Open
MichaelKv opened this issue Dec 10, 2021 · 0 comments
Open

Comments

@MichaelKv
Copy link

ImPlot heavily relies on DragLineX call order but it shall not (IMO)
Hello.
Let us change the void ShowDemo_DragLines() code the following way:
Old code:
`ImPlot::DragLineX(0,&x1,ImVec4(1,1,1,1),1,flags);
ImPlot::DragLineX(1,&x2,ImVec4(1,1,1,1),1,flags);

New code:
if (x1 < x2) {
ImPlot::DragLineX(0, &x1, ImVec4(1, 1, 1, 1), 1, flags);
ImPlot::DragLineX(1, &x2, ImVec4(1, 1, 1, 1), 1, flags);
}
else {
ImPlot::DragLineX(1, &x2, ImVec4(1, 1, 1, 1), 1, flags);
ImPlot::DragLineX(0, &x1, ImVec4(1, 1, 1, 1), 1, flags);
}`
And everything stops working if one dragging lineX goes over the another one.
In my very case the drag lines are sorted and I cannot afford to use static variable in a real-life application.
Please, inform me if it is the intentional behavior.

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

1 participant