changeset 679:ad3e5693cb76 scale-alternative

Alternative, and much simpler, approach to scaling
author Chris Cannam
date Thu, 06 Dec 2018 15:55:20 +0000
parents 0329bbd4b57c
children ac7b40a64109
files src/changesetview.cpp src/panned.cpp
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/changesetview.cpp	Thu Dec 06 13:54:34 2018 +0000
+++ b/src/changesetview.cpp	Thu Dec 06 15:55:20 2018 +0000
@@ -59,6 +59,7 @@
 
     paint->save();
     QFont f(paint->font());
+    f.setPixelSize(11);
     f.setBold(true);
     paint->setFont(f);
 
--- a/src/panned.cpp	Thu Dec 06 13:54:34 2018 +0000
+++ b/src/panned.cpp	Thu Dec 06 15:55:20 2018 +0000
@@ -34,6 +34,19 @@
     connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeout()));
     setRenderHints(QPainter::Antialiasing |
                    QPainter::TextAntialiasing);
+
+    double baseEm;
+#ifdef Q_OS_MAC
+    baseEm = 17.0;
+#else
+    baseEm = 15.0;
+#endif
+    double em = QFontMetrics(QFont()).height();
+    double ratio = em / baseEm;
+
+    QMatrix m = matrix();
+    m.scale(ratio, ratio);
+    setMatrix(m);
 }
 
 void