diff view/Pane.cpp @ 1401:28075cc658c9

Scale pen for retina display on macOS as well as for hidpi display elsewhere
author Chris Cannam
date Thu, 15 Nov 2018 14:04:32 +0000
parents 9ea551137329
children b0eeec95ab5b
line wrap: on
line diff
--- a/view/Pane.cpp	Thu Nov 15 13:06:38 2018 +0000
+++ b/view/Pane.cpp	Thu Nov 15 14:04:32 2018 +0000
@@ -688,7 +688,7 @@
         c = QColor(240, 240, 240);
     }
 
-    paint.setPen(PaintAssistant::scalePen(c));
+    paint.setPen(scalePen(c));
     int x = width() / 2;
 
     if (!omitLine) {
@@ -1173,7 +1173,7 @@
 
     if (!m_manager) return Selection();
 
-    sv_frame_t testFrame = getFrameForX(x - ViewManager::scalePixelSize(5));
+    sv_frame_t testFrame = getFrameForX(x - scaleSize(5));
     if (testFrame < 0) {
         testFrame = getFrameForX(x);
         if (testFrame < 0) return Selection();
@@ -1185,14 +1185,14 @@
     int lx = getXForFrame(selection.getStartFrame());
     int rx = getXForFrame(selection.getEndFrame());
     
-    int fuzz = ViewManager::scalePixelSize(2);
+    int fuzz = scaleSize(2);
     if (x < lx - fuzz || x > rx + fuzz) return Selection();
 
     int width = rx - lx;
-    fuzz = ViewManager::scalePixelSize(3);
+    fuzz = scaleSize(3);
     if (width < 12) fuzz = width / 4;
-    if (fuzz < ViewManager::scalePixelSize(1)) {
-        fuzz = ViewManager::scalePixelSize(1);
+    if (fuzz < scaleSize(1)) {
+        fuzz = scaleSize(1);
     }
 
     if (x < lx + fuzz) closeToLeftEdge = true;