epezent / epezent/implot

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

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6.2k
Forks
693
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.