Mercurial > hg > easyhg
comparison 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 |
comparison
equal
deleted
inserted
replaced
677:0329bbd4b57c | 679:ad3e5693cb76 |
---|---|
32 m_dragTimer = new QTimer(this); | 32 m_dragTimer = new QTimer(this); |
33 m_dragTimerMs = 50; | 33 m_dragTimerMs = 50; |
34 connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeout())); | 34 connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeout())); |
35 setRenderHints(QPainter::Antialiasing | | 35 setRenderHints(QPainter::Antialiasing | |
36 QPainter::TextAntialiasing); | 36 QPainter::TextAntialiasing); |
37 | |
38 double baseEm; | |
39 #ifdef Q_OS_MAC | |
40 baseEm = 17.0; | |
41 #else | |
42 baseEm = 15.0; | |
43 #endif | |
44 double em = QFontMetrics(QFont()).height(); | |
45 double ratio = em / baseEm; | |
46 | |
47 QMatrix m = matrix(); | |
48 m.scale(ratio, ratio); | |
49 setMatrix(m); | |
37 } | 50 } |
38 | 51 |
39 void | 52 void |
40 Panned::resizeEvent(QResizeEvent *ev) | 53 Panned::resizeEvent(QResizeEvent *ev) |
41 { | 54 { |