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

Make ImPlotAxisFlags_Lock disable axis mouse highlighting #372

Closed
CosminPerRam opened this issue Jun 23, 2022 · 3 comments
Closed

Make ImPlotAxisFlags_Lock disable axis mouse highlighting #372

CosminPerRam opened this issue Jun 23, 2022 · 3 comments

Comments

@CosminPerRam
Copy link

CosminPerRam commented Jun 23, 2022

As said in the title, I would like to propose a very simple change to make the 'dragging' (or highlighting) of an axis disabled while having the ImPlotAxisFlags_Lock set, I find it a bit confusing to have the axis locked and still being able to drag(/cross over it and getting highlighted resulting) in no move.
I have tried to look if there is already a way to do this but I couldn't find any (if there is already a way, sorry and please point it out).

This is a short video of what I'm talking about:
https://user-images.githubusercontent.com/7972857/175363916-f39b50e8-58a0-483b-a765-0c9e5f4dc321.mp4

@epezent
Copy link
Owner

epezent commented Jun 24, 2022

That was a very unpleasant sound lol.

ImPlotAxisFlags_Lock should only be locking the min and max range, i.e. prevent panning. It was never the intention for it to also prevent dragging to the opposite side, so this actually seems like a bug -- I'll look into it. We may need a new flag, e.g. ImPlotAxisFlags_NoHover and/or ImPlotAxisFlags_NoSwap to do the things you want. Can you briefly describe the exact behavior you're trying to implement?

PS -- the flags passed on lines 336 and 337 will overwrite the flags passed on 335, in case you weren't aware

@CosminPerRam
Copy link
Author

PS -- the flags passed on lines 336 and 337 will overwrite the flags passed on 335, in case you weren't aware

Oops, thanks for that.

[...] i.e. prevent panning. It was never the intention for it to also prevent dragging to the opposite side, so this actually seems like a bug -- I'll look into it.

Oh alright, I got a bit confused about the axis flags.

Can you briefly describe the exact behavior you're trying to implement?

I just want the label axes to not be movable and to not be highlighted when I cross my mouse over them.
Having the ImPlotAxisFlags_NoHover flag would only be confusing (e.g. you think a axis is not movable because its not getting highlighted), but ImPlotAxisFlags_NoSwap sounds great (and it should implicitly make the axes not highlighed on hover).

@epezent
Copy link
Owner

epezent commented Jul 8, 2022

Hello again! 7a470b2 adds ImPlotAxisFlags_NoSideSwitch and ImPlotAxisFlags_NoHighlight (same idea as above, different names).

I just want the label axes to not be movable and to not be highlighted when I cross my mouse over them.
Having the ImPlotAxisFlags_NoHover flag would only be confusing (e.g. you think a axis is not movable because its not getting highlighted), but ImPlotAxisFlags_NoSwap sounds great (and it should implicitly make the axes not highlighed on hover).

I think hover highlighting and side switching should be separable. Highlighting can still suggest an axis is interactive (i.e. pannable, clickable) even if side switching is disabled. An argument might be made for implicitly disabling highlighting if ImPlotAxisFlags_NoSideSwitch, ImPlotAxisFlags_Lock, AND ImPlotAxisFlags_NoMenus were enabled, but that feels a bit excessive to me. Seems simpler to just provide ImPlotAxisFlags_NoHighlight so users can turn off the hover/hold highlight if they want to.

@epezent epezent closed this as completed Jul 8, 2022
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