From 2cdc404eb42decbac8e135aa0d39df57bc5d82ee Mon Sep 17 00:00:00 2001 From: Date: Wed, 27 Dec 2017 23:18:42 +0100 Subject: [PATCH] fixed rounding issue that caused an infinite loop --- src/widgets/scrollbar.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index e97ccbf24..ba991c139 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #define MIN_THUMB_HEIGHT 10 @@ -208,13 +209,13 @@ void ScrollBar::setCurrentValue(qreal value) value = std::max(this->minimum, std::min(this->maximum - this->largeChange, value + this->smoothScrollingOffset)); - if (this->currentValue != value) { + if (std::abs(this->currentValue - value) > 0.000001) { this->currentValue = value; - updateScroll(); + this->updateScroll(); this->currentValueChanged(); - update(); + this->update(); } }