diff 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
line wrap: on
line diff
--- a/view/View.cpp	Wed Mar 11 13:54:01 2015 +0000
+++ b/view/View.cpp	Wed Mar 11 15:35:20 2015 +0000
@@ -58,6 +58,7 @@
     m_followPlayIsDetached(false),
     m_playPointerFrame(0),
     m_showProgress(showProgress),
+    m_paintScale(1),
     m_cache(0),
     m_cacheCentreFrame(0),
     m_cacheZoomLevel(1024),
@@ -1658,6 +1659,14 @@
     paint.setFont(font);
 }
 
+QRect
+View::getPaintRect() const
+{
+    QRect r(rect());
+    return QRect(r.x() * m_paintScale, r.y() * m_paintScale, 
+                 r.width() * m_paintScale, r.height() * m_paintScale);
+}
+
 void
 View::paintEvent(QPaintEvent *e)
 {
@@ -1838,9 +1847,11 @@
 	if (repaintCache) {
             paint.begin(m_cache);
             rectToPaint = scaledCacheRect;
+            m_paintScale = dpratio;
         } else {
             paint.begin(this);
             rectToPaint = cacheRect;
+            m_paintScale = 1;
         }
 
         setPaintFont(paint);