Skip to content

Constrains should scroll rather than zoom if possible. #537

Open
@Nahor

Description

When scrolling an axis, if the new axis range gets outside the constraints, Implot will fix the limit that is outside and leave the other unchanged (if applicable). It will then compute what the zoom level must be. A user is probably not expecting the zoom to be changed.

For instance, the "Axis constraints" example:

  • zoom out the X-axis to be slightly narrower than the constraints (say [-10..+8]).
  • quickly scroll the axis back-and-forth between the two extreme multiple times.
  • scroll left up to -10.
    => Take note of the right limit: it is no longer +8 but much less (in my video, it's now -2.5 or so).
Constraint.mp4

Expected:
When correcting one side of an axis, the other side should be changed by the same amount, and if both sides cannot fit within the constraints (i.e. the user must be zooming out, or the constraints changed), then and only then should the zoom factor be changed.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions