fixed scrollbar divide by zero
This commit is contained in:
@@ -219,6 +219,11 @@ void Scrollbar::paintEvent(QPaintEvent *)
|
|||||||
// draw highlights
|
// draw highlights
|
||||||
auto snapshot = this->highlights.getSnapshot();
|
auto snapshot = this->highlights.getSnapshot();
|
||||||
int snapshotLength = (int)snapshot.getLength();
|
int snapshotLength = (int)snapshot.getLength();
|
||||||
|
|
||||||
|
if (snapshotLength == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int w = this->width();
|
int w = this->width();
|
||||||
float y = 0;
|
float y = 0;
|
||||||
float dY = (this->height() - MIN_THUMB_HEIGHT) / snapshotLength;
|
float dY = (this->height() - MIN_THUMB_HEIGHT) / snapshotLength;
|
||||||
|
|||||||
Reference in New Issue
Block a user