diff view/View.h @ 952:b1aa74ce697e osx-retina

Always render to a buffer, then from that to the widget
author Chris Cannam
date Mon, 27 Apr 2015 11:38:01 +0100
parents a5488775f880
children 092de22db207
line wrap: on
line diff
--- a/view/View.h	Mon Apr 20 15:59:03 2015 +0100
+++ b/view/View.h	Mon Apr 27 11:38:01 2015 +0100
@@ -389,6 +389,14 @@
     virtual bool shouldLabelSelections() const { return true; }
     virtual bool render(QPainter &paint, int x0, sv_frame_t f0, sv_frame_t f1);
     virtual void setPaintFont(QPainter &paint);
+
+    QSize scaledSize(const QSize &s, int factor) {
+        return QSize(s.width() * factor, s.height() * factor);
+    }
+    QRect scaledRect(const QRect &r, int factor) {
+        return QRect(r.x() * factor, r.y() * factor,
+                     r.width() * factor, r.height() * factor);
+    }
     
     typedef std::vector<Layer *> LayerList;
 
@@ -429,6 +437,7 @@
     bool                m_showProgress;
 
     QPixmap            *m_cache;
+    QPixmap            *m_buffer;
     sv_frame_t          m_cacheCentreFrame;
     int                 m_cacheZoomLevel;
     bool                m_selectionCached;