Mercurial > hg > easyhg
diff src/panned.cpp @ 679:ad3e5693cb76 scale-alternative
Alternative, and much simpler, approach to scaling
author | Chris Cannam |
---|---|
date | Thu, 06 Dec 2018 15:55:20 +0000 |
parents | ce29dc775650 |
children |
line wrap: on
line diff
--- 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