comparison 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
comparison
equal deleted inserted replaced
1269:f2894944c6b8 1270:7527701c8076
1213 { 1213 {
1214 closeToLeftEdge = closeToRightEdge = false; 1214 closeToLeftEdge = closeToRightEdge = false;
1215 1215
1216 if (!m_manager) return Selection(); 1216 if (!m_manager) return Selection();
1217 1217
1218 sv_frame_t testFrame = getFrameForX(x - 5); 1218 sv_frame_t testFrame = getFrameForX(x - ViewManager::scalePixelSize(5));
1219 if (testFrame < 0) { 1219 if (testFrame < 0) {
1220 testFrame = getFrameForX(x); 1220 testFrame = getFrameForX(x);
1221 if (testFrame < 0) return Selection(); 1221 if (testFrame < 0) return Selection();
1222 } 1222 }
1223 1223
1225 if (selection.isEmpty()) return selection; 1225 if (selection.isEmpty()) return selection;
1226 1226
1227 int lx = getXForFrame(selection.getStartFrame()); 1227 int lx = getXForFrame(selection.getStartFrame());
1228 int rx = getXForFrame(selection.getEndFrame()); 1228 int rx = getXForFrame(selection.getEndFrame());
1229 1229
1230 int fuzz = 2; 1230 int fuzz = ViewManager::scalePixelSize(2);
1231 if (x < lx - fuzz || x > rx + fuzz) return Selection(); 1231 if (x < lx - fuzz || x > rx + fuzz) return Selection();
1232 1232
1233 int width = rx - lx; 1233 int width = rx - lx;
1234 fuzz = 3; 1234 fuzz = ViewManager::scalePixelSize(3);
1235 if (width < 12) fuzz = width / 4; 1235 if (width < 12) fuzz = width / 4;
1236 if (fuzz < 1) fuzz = 1; 1236 if (fuzz < ViewManager::scalePixelSize(1)) {
1237 fuzz = ViewManager::scalePixelSize(1);
1238 }
1237 1239
1238 if (x < lx + fuzz) closeToLeftEdge = true; 1240 if (x < lx + fuzz) closeToLeftEdge = true;
1239 if (x > rx - fuzz) closeToRightEdge = true; 1241 if (x > rx - fuzz) closeToRightEdge = true;
1240 1242
1241 return selection; 1243 return selection;