epezent / epezent/implot

`Constrains` should scroll rather than zoom if possible.

Open
#537 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
6.2k
Forks
693
PR merge metrics
No merged PRs in 30d

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).

https://github.com/epezent/implot/assets/1198364/4ff1a491-02ce-49f2-9eaa-3a14ab57f4dd

**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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.