]> git.sesse.net Git - nageru/commitdiff
Don't set QGradient stops after 1.0.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 27 Sep 2018 19:03:36 +0000 (21:03 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 27 Sep 2018 19:03:36 +0000 (21:03 +0200)
clip_list.cpp

index 69a87aee64ef2e3a66b5665c89b0a65f41c5bb80..69a6334cd473984d1b730998464c61cc5af422cc 100644 (file)
@@ -137,7 +137,9 @@ QVariant PlayList::data(const QModelIndex &parent, int role) const {
                                grad.setCoordinateMode(grad.QGradient::ObjectBoundingMode);
                                grad.setColorAt(0.0f, QColor::fromRgbF(0.0f, 0.0f, 1.0f, 0.2f));
                                grad.setColorAt(play_progress, QColor::fromRgbF(0.0f, 0.0f, 1.0f, 0.2f));
-                               grad.setColorAt(play_progress + 0.01f, QColor::fromRgbF(0.0f, 0.0f, 1.0f, 0.0f));
+                               if (play_progress + 0.01f <= 1.0f) {
+                                       grad.setColorAt(play_progress + 0.01f, QColor::fromRgbF(0.0f, 0.0f, 1.0f, 0.0f));
+                               }
                                return QBrush(grad);
                        } else {
                                return QVariant();