Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,7 @@ bool UpdateInput(ImPlotPlot& plot) {
if (IO.MouseDelta.x != 0 && !x_axis.IsPanLocked(increasing)) {
const double plot_l = x_axis.PixelsToPlot(plot.PlotRect.Min.x - IO.MouseDelta.x);
const double plot_r = x_axis.PixelsToPlot(plot.PlotRect.Max.x - IO.MouseDelta.x);
x_axis.SetMin(x_axis.IsInverted() ? plot_r : plot_l);
x_axis.SetMax(x_axis.IsInverted() ? plot_l : plot_r);
x_axis.SetRange(x_axis.IsInverted() ? plot_r : plot_l, x_axis.IsInverted() ? plot_l : plot_r);
if (axis_equal && x_axis.OrthoAxis != NULL)
x_axis.OrthoAxis->SetAspect(x_axis.GetAspect());
changed = true;
Expand All @@ -1925,8 +1924,7 @@ bool UpdateInput(ImPlotPlot& plot) {
if (IO.MouseDelta.y != 0 && !y_axis.IsPanLocked(increasing)) {
const double plot_t = y_axis.PixelsToPlot(plot.PlotRect.Min.y - IO.MouseDelta.y);
const double plot_b = y_axis.PixelsToPlot(plot.PlotRect.Max.y - IO.MouseDelta.y);
y_axis.SetMin(y_axis.IsInverted() ? plot_t : plot_b);
y_axis.SetMax(y_axis.IsInverted() ? plot_b : plot_t);
y_axis.SetRange(y_axis.IsInverted() ? plot_t : plot_b, y_axis.IsInverted() ? plot_b : plot_t);
if (axis_equal && y_axis.OrthoAxis != NULL)
y_axis.OrthoAxis->SetAspect(y_axis.GetAspect());
changed = true;
Expand Down