improve mousewheel zooming performance

This commit is contained in:
Leopixelo
2026-06-29 21:23:24 +02:00
parent f1a9e0d83e
commit 51862b5c54
+2 -2
View File
@@ -9646,7 +9646,7 @@ void QCPAxis::wheelEvent(QWheelEvent *event)
const double wheelSteps = delta/120.0; // a single step delta is +/-120 usually const double wheelSteps = delta/120.0; // a single step delta is +/-120 usually
const double factor = qPow(mAxisRect->rangeZoomFactor(orientation()), wheelSteps); const double factor = qPow(mAxisRect->rangeZoomFactor(orientation()), wheelSteps);
scaleRange(factor, pixelToCoord(orientation() == Qt::Horizontal ? pos.x() : pos.y())); scaleRange(factor, pixelToCoord(orientation() == Qt::Horizontal ? pos.x() : pos.y()));
mParentPlot->replot(); mParentPlot->replot(QCustomPlot::rpQueuedReplot);
} }
/*! \internal /*! \internal
@@ -18697,7 +18697,7 @@ void QCPAxisRect::wheelEvent(QWheelEvent *event)
axis->scaleRange(factor, axis->pixelToCoord(pos.y())); axis->scaleRange(factor, axis->pixelToCoord(pos.y()));
} }
} }
mParentPlot->replot(); mParentPlot->replot(QCustomPlot::rpQueuedReplot);
} }
} }
} }