diff widgets/Panner.cpp @ 1238:4d0ca1ab4cd0

Some work to make spectrum layers (and slice layers generally) zoomable in the frequency axis. Also fixes a number of view id mixups in SliceLayer which broke offset calculations for the x axis scale.
author Chris Cannam
date Tue, 07 Feb 2017 14:55:19 +0000
parents 4a578a360011
children 13f5f84fbfad
line wrap: on
line diff
--- a/widgets/Panner.cpp	Fri Jan 27 13:19:21 2017 +0000
+++ b/widgets/Panner.cpp	Tue Feb 07 14:55:19 2017 +0000
@@ -20,6 +20,8 @@
 #include <QWheelEvent>
 #include <QPainter>
 
+#include "WidgetScale.h"
+
 #include <iostream>
 #include <cmath>
 
@@ -156,9 +158,13 @@
     QColor bg(palette().background().color());
     bg.setAlpha(m_backgroundAlpha);
 
-    paint.setPen(palette().dark().color());
+    int penWidth = WidgetScale::scalePixelSize(1);
+    if (penWidth < 1) penWidth = 1;
+    paint.setPen(QPen(palette().dark().color(), penWidth));
+    
     paint.setBrush(bg);
-    paint.drawRect(0, 0, width()-1, height()-1);
+    paint.drawRect(penWidth/2, penWidth/2,
+                   width()-penWidth/2-1, height()-penWidth/2-1);
 
     QColor hl(m_thumbColour);
     hl.setAlpha(m_thumbAlpha);