diff view/Pane.cpp @ 1270:7527701c8076

Make selection extents more visible on hi-dpi
author Chris Cannam
date Thu, 19 Apr 2018 14:36:16 +0100
parents f2894944c6b8
children 1d7921b1852f
line wrap: on
line diff
--- a/view/Pane.cpp	Thu Apr 19 14:35:59 2018 +0100
+++ b/view/Pane.cpp	Thu Apr 19 14:36:16 2018 +0100
@@ -1215,7 +1215,7 @@
 
     if (!m_manager) return Selection();
 
-    sv_frame_t testFrame = getFrameForX(x - 5);
+    sv_frame_t testFrame = getFrameForX(x - ViewManager::scalePixelSize(5));
     if (testFrame < 0) {
         testFrame = getFrameForX(x);
         if (testFrame < 0) return Selection();
@@ -1227,13 +1227,15 @@
     int lx = getXForFrame(selection.getStartFrame());
     int rx = getXForFrame(selection.getEndFrame());
     
-    int fuzz = 2;
+    int fuzz = ViewManager::scalePixelSize(2);
     if (x < lx - fuzz || x > rx + fuzz) return Selection();
 
     int width = rx - lx;
-    fuzz = 3;
+    fuzz = ViewManager::scalePixelSize(3);
     if (width < 12) fuzz = width / 4;
-    if (fuzz < 1) fuzz = 1;
+    if (fuzz < ViewManager::scalePixelSize(1)) {
+        fuzz = ViewManager::scalePixelSize(1);
+    }
 
     if (x < lx + fuzz) closeToLeftEdge = true;
     if (x > rx - fuzz) closeToRightEdge = true;