fixed rounding issue that caused an infinite loop
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#define MIN_THUMB_HEIGHT 10
|
#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 = std::max(this->minimum, std::min(this->maximum - this->largeChange,
|
||||||
value + this->smoothScrollingOffset));
|
value + this->smoothScrollingOffset));
|
||||||
|
|
||||||
if (this->currentValue != value) {
|
if (std::abs(this->currentValue - value) > 0.000001) {
|
||||||
this->currentValue = value;
|
this->currentValue = value;
|
||||||
|
|
||||||
updateScroll();
|
this->updateScroll();
|
||||||
this->currentValueChanged();
|
this->currentValueChanged();
|
||||||
|
|
||||||
update();
|
this->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user