epezent / epezent/implot

Using Axis Limit Constraints causes zooming when panning

Open
#633 1 comment 0 reactions 1 assignee Claimed by @brenocq View on GitHub
prio:medium status:todo type:fix
Dominant language
C++
Stars
6.2k
Forks
693
PR merge metrics
No merged PRs in 30d

Description

In this simplified code snippet below, I use the SetupAxisLimitsConstraint method to keep my barchart within a desired range (along with zoom constraints)

ImPlot::BeginPlot(chart_name.c_str(), ImVec2(-1, 0), ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMenus | ImPlotFlags_NoMouseText)) {
ImPlot::SetupAxis(ImAxis_X1, x_axes_name.c_str());
ImPlot::SetupAxis(ImAxis_Y1, y_axes_name.c_str(), ImPlotAxisFlags_AutoFit);
**ImPlot::SetupAxisLimitsConstraints(ImAxis_X1, 0, 190.35);
ImPlot::SetupAxisZoomConstraints(ImAxis_X1, 0, 190.35);**
}

But when zooming in a tad (see below)

Image

and then panning left outside of the window, then right outside of the window, and doing so repeatedly (never using the zoom input), the range seems to be closing in / zooming in:

Image
(notice it is now ~60-120)

I think this might be a bug so wanted to bring it up as an issue here.

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.