From 6fec6514faffdfe7aa2f3b9c9e517e2606835c77 Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 6 Jan 2018 21:45:50 +0100 Subject: [PATCH] made int division float division --- src/widgets/scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index 1acb0eb14..4b662d532 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -226,7 +226,7 @@ void Scrollbar::paintEvent(QPaintEvent *) int w = this->width(); float y = 0; - float dY = (this->height() - MIN_THUMB_HEIGHT) / snapshotLength; + float dY = (float)(this->height() + MIN_THUMB_HEIGHT) / (float)snapshotLength; int highlightHeight = std::ceil(dY); for (int i = 0; i < snapshotLength; i++) {