diff --git a/app/gui/oven_control/slider.cpp b/app/gui/oven_control/slider.cpp index 78e41b5..7bbab93 100644 --- a/app/gui/oven_control/slider.cpp +++ b/app/gui/oven_control/slider.cpp @@ -243,8 +243,8 @@ void Slider::resizeEvent(QResizeEvent */*event*/) int Slider::calcSliderPosition(int mouseX) { - int x = qBound(grooveMin, mouseX, grooveMax); - qreal pos = (qreal) (x - grooveMin) / (grooveMax - grooveMin) * (maximum_ - minimum_) + minimum_; + int x = qBound(minSliderX, mouseX, maxSliderX); + qreal pos = (qreal) (x - minSliderX) / (maxSliderX - minSliderX) * (maximum_ - minimum_) + minimum_; return qRound(pos); } @@ -255,8 +255,8 @@ int Slider::calcSubLength(int value) void Slider::updatePixmapPosition() { - grooveMin = (width() - sub.width()) / 2; - grooveMax = width() - grooveMin; + minSliderX = (width() - sub.width()) / 2; + maxSliderX = width() - minSliderX; groovePoint = QPoint((width() - groove.width()) / 2, (height() - groove.height()) / 2); subPoint = QPoint((width() - sub.width()) / 2, (height() - sub.height()) / 2);