imgui-knobs
imgui-knobs copied to clipboard
Is it possible to allow for Vertical and Horizontal drag to be treated as the same thing?
Is it possible to allow for Vertical and Horizontal drag to be treated as the same thing? This is standard practice and makes knobs and sliders easier and more intuitive to use. In other words, dragging up/diagonally/right all produce the same outcome. The math is straightforward, just requiring a check to see if vertical or horizontal mouse positions are greater and just use the greater value.
Sure that would be possible. I don't have a lot of time at the moment, but will look into it at some point. Happy to accept a PR too :)
@elanhickler @altschuler I'm happy submit a PR for this but need some info.
- Should there still be support for horizontal and vertical modes?
- Should this greater-value behavior be the default?
@elanhickler @altschuler I'm happy submit a PR for this but need some info.
* Should there still be support for horizontal and vertical modes? * Should this greater-value behavior be the default?
I haven't tried it out, but if this behavior is arguably better and more intuitive I think it should be default, yes. In that case we can keep the ImGuiKnobFlags_DragHorizontal flag and add a ImGuiKnobFlags_DragVertical one for the current behavior. Otherwise, if it's a matter of preference which is better, then adding a ImGuiKnobFlags_DragDistance or similarily named flag for the new behavior might be better suited.
That's in line with the assumptions I had, thanks for confirming. I'll try to take a look at it this weekend.
@RobertAlbus I tested this out and found that it's arguably better using bi-directional dragging, so I made that default.