mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed scrollbar divide by zero
This commit is contained in:
parent
b8e268f969
commit
29046b3aa1
|
@ -219,6 +219,11 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
|||
// draw highlights
|
||||
auto snapshot = this->highlights.getSnapshot();
|
||||
int snapshotLength = (int)snapshot.getLength();
|
||||
|
||||
if (snapshotLength == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int w = this->width();
|
||||
float y = 0;
|
||||
float dY = (this->height() - MIN_THUMB_HEIGHT) / snapshotLength;
|
||||
|
|
Loading…
Reference in a new issue