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

SetNextPlotDragDisable #98

Closed
wants to merge 9 commits into from
Closed

SetNextPlotDragDisable #98

wants to merge 9 commits into from

Conversation

ozlb
Copy link
Contributor

@ozlb ozlb commented Aug 19, 2020

Set drag operations disable for the next plot. Call right before BeginPlot().
#89 (comment)

Set drag operations disable for the next plot. Call right before BeginPlot(). 
#89 (comment)
@epezent
Copy link
Owner

epezent commented Aug 20, 2020

I understand what this does, but I don't understand why it's needed. Alternatively, the axis flags could be temporarily modified to include ImPlotAxisFlags_LockMin and ImPlotAxisFlags_LockMax. What particular problem are you trying to solve?

@ozlb
Copy link
Contributor Author

ozlb commented Aug 20, 2020

Assume that you want to customize with "widget" a plot
Assume that you want to interact with that "widget" and drag it
a) you need to be after BeginPlot() and before EndPlot() in order to get DrawList and to render it
b) drag of axis and query is inside BeginPlot so it's BEFORE the "widget" code so it will always win if you want to interlock "widget" drag operation with an active axis or query drag operation.
c) You need to lock axis, query and potentially all future "begin of drag operations", like the one mentioned from labels in Issue #89

@epezent
Copy link
Owner

epezent commented Aug 20, 2020

Ok, that makes sense. Let me think on this and make sure there isn't a better solution. I can see potential headaches with the approach you described. Needing widget logic/input detection before BeginPlot, then SetNextPlotDragDisable conditioned on that logic, and then widget rendering after BeginPlot seems a bit burdensome. Perhaps it's time to properly implement custom a widget/tooltip system. Maybe via callbacks?

@ozlb
Copy link
Contributor Author

ozlb commented Aug 20, 2020

I’m with you that it’s not perfect. Callback could be a solution, you have a better vision of actual status and direction for future.

If FitNextPlotAxis is constantly called, avoid axis scroll flickering
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

Successfully merging this pull request may close these issues.

2 participants