You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you want to adjust the graphics with a checkbox using set_axis_limits, these graphics are adjusted when the checkbox is activated. Still, when the checkbox is cleared, only one axis ("x1" and "y1") returns to normal using set_axis_limits_auto, the rest of the axes do not.
To Reproduce
Steps to reproduce the behavior:
Go to move the axes.
Click on checkbox (activate)
Move the axes (all are locked)
Click on checkbox (deactivate)
Move the axes (only "x1" and "y1" are unblocked)
See error
Expected behavior
Activating the checkbox locks the axes, but deactivating the checkbox should unlock all axes (not only "x1" and "y1").
Screenshots/Video
Adjust.plots.error.with.checkbox.mp4
Standalone, minimal, complete and verifiable example
For reference, here are some details and analysis from the corresponding Discord thread (quoting myself)...
When you do set_axis_limits, DPG tells ImPlot to apply limits on the axis, which sets axis into the locked state. DPG repeats this every frame until you call set_axis_limits_auto. And this is where the difference starts to show up. For some reason, ImPlot does not have an API call to reset the "locked" state (axis.HasRange == true) back into "unlocked". This means, once you set an axis to a locked state via API, the only thing that can unlock it is the ImPlot engine itself. And ImPlot does indeed reset the state on every axis in BeginPlot... only that it actually happens for primary axes only (X1/Y1) - because other axes are not enabled yet at BeginPlot time (DPG configures them later, as per ImPlot API guidelines).
I'd say this is purely an ImPlot issue.
Also, in future we'd need to review the behavior of set_axis_limts, set_axis_limts_constraints, reset_axis_limts_constraints and come up with a convenient yet backwards-compatible way to deal with the limits. At the moment, set_axis_limts and set_axis_limts_constraints look a bit similar but they actually show subtle differences in behavior.
Version of Dear PyGui
Version: 2.0
Operating System: Windows 11
My Issue/Question
When you want to adjust the graphics with a checkbox using set_axis_limits, these graphics are adjusted when the checkbox is activated. Still, when the checkbox is cleared, only one axis ("x1" and "y1") returns to normal using set_axis_limits_auto, the rest of the axes do not.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Activating the checkbox locks the axes, but deactivating the checkbox should unlock all axes (not only "x1" and "y1").
Screenshots/Video
Adjust.plots.error.with.checkbox.mp4
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: