changeset 1307:5af5c611f4cb

Improve level-pan rendering quality on non-retina OSX
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 26 Jun 2018 08:35:49 +0100
parents 5db672d6de4f
children e7c9650e74a7
files widgets/LevelPanWidget.cpp
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/LevelPanWidget.cpp	Mon Jun 25 15:29:47 2018 +0100
+++ b/widgets/LevelPanWidget.cpp	Tue Jun 26 08:35:49 2018 +0100
@@ -350,7 +350,7 @@
 QSizeF
 LevelPanWidget::cellLightSize(QRectF rect) const
 {
-    double extent = 3. / 4.;
+    double extent = 0.7;
     QSizeF cs = cellSize(rect);
     double m = std::min(cs.width(), cs.height());
     return QSizeF(m * extent, m * extent);
@@ -387,7 +387,7 @@
 LevelPanWidget::cellOutlineRect(QRectF rect, int row, int col) const
 {
     QRectF clr = cellLightRect(rect, row, col);
-    double adj = thinLineWidth(rect)/2;
+    double adj = thinLineWidth(rect)/2 + 0.5;
     return clr.adjusted(-adj, -adj, adj, adj);
 }
 
@@ -531,13 +531,11 @@
                                           clr.height()/4));
                 } else {
                     paint.setPen(Qt::NoPen);
-                    if (outline == half) {
-                        clr = cellOutlineRect(rect, cell, pan);
-                    }
-                    paint.drawRect(QRectF(clr.x(),
-                                          clr.y() - 0.5,
-                                          clr.width(),
-                                          clr.height()/2));
+                    QRectF cor = cellOutlineRect(rect, cell, pan);
+                    paint.drawRect(QRectF(cor.x(),
+                                          cor.y() - 0.5,
+                                          cor.width(),
+                                          cor.height()/2));
                 }
             }