mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed rounding issue that caused an infinite loop
This commit is contained in:
parent
9bbacdfae4
commit
2cdc404eb4
1 changed files with 4 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
#include <cmath>
|
||||
|
||||
#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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue