Mercurial > hg > svgui
comparison view/View.cpp @ 915:f6d9f28f37cb osx-retina
Experiment with querying paint rect separately from view rect
| author | Chris Cannam |
|---|---|
| date | Wed, 11 Mar 2015 15:35:20 +0000 |
| parents | 59e51842cf39 |
| children | a5488775f880 |
comparison
equal
deleted
inserted
replaced
| 914:59e51842cf39 | 915:f6d9f28f37cb |
|---|---|
| 56 m_followZoom(true), | 56 m_followZoom(true), |
| 57 m_followPlay(PlaybackScrollPageWithCentre), | 57 m_followPlay(PlaybackScrollPageWithCentre), |
| 58 m_followPlayIsDetached(false), | 58 m_followPlayIsDetached(false), |
| 59 m_playPointerFrame(0), | 59 m_playPointerFrame(0), |
| 60 m_showProgress(showProgress), | 60 m_showProgress(showProgress), |
| 61 m_paintScale(1), | |
| 61 m_cache(0), | 62 m_cache(0), |
| 62 m_cacheCentreFrame(0), | 63 m_cacheCentreFrame(0), |
| 63 m_cacheZoomLevel(1024), | 64 m_cacheZoomLevel(1024), |
| 64 m_selectionCached(false), | 65 m_selectionCached(false), |
| 65 m_deleting(false), | 66 m_deleting(false), |
| 1654 View::setPaintFont(QPainter &paint) | 1655 View::setPaintFont(QPainter &paint) |
| 1655 { | 1656 { |
| 1656 QFont font(paint.font()); | 1657 QFont font(paint.font()); |
| 1657 font.setPointSize(Preferences::getInstance()->getViewFontSize()); | 1658 font.setPointSize(Preferences::getInstance()->getViewFontSize()); |
| 1658 paint.setFont(font); | 1659 paint.setFont(font); |
| 1660 } | |
| 1661 | |
| 1662 QRect | |
| 1663 View::getPaintRect() const | |
| 1664 { | |
| 1665 QRect r(rect()); | |
| 1666 return QRect(r.x() * m_paintScale, r.y() * m_paintScale, | |
| 1667 r.width() * m_paintScale, r.height() * m_paintScale); | |
| 1659 } | 1668 } |
| 1660 | 1669 |
| 1661 void | 1670 void |
| 1662 View::paintEvent(QPaintEvent *e) | 1671 View::paintEvent(QPaintEvent *e) |
| 1663 { | 1672 { |
| 1836 QRect rectToPaint; | 1845 QRect rectToPaint; |
| 1837 | 1846 |
| 1838 if (repaintCache) { | 1847 if (repaintCache) { |
| 1839 paint.begin(m_cache); | 1848 paint.begin(m_cache); |
| 1840 rectToPaint = scaledCacheRect; | 1849 rectToPaint = scaledCacheRect; |
| 1850 m_paintScale = dpratio; | |
| 1841 } else { | 1851 } else { |
| 1842 paint.begin(this); | 1852 paint.begin(this); |
| 1843 rectToPaint = cacheRect; | 1853 rectToPaint = cacheRect; |
| 1854 m_paintScale = 1; | |
| 1844 } | 1855 } |
| 1845 | 1856 |
| 1846 setPaintFont(paint); | 1857 setPaintFont(paint); |
| 1847 paint.setClipRect(rectToPaint); | 1858 paint.setClipRect(rectToPaint); |
| 1848 | 1859 |
