diff layer/ScrollableImageCache.h @ 1325:bc2cb82050a0 zoom

Gradual ZoomLevel updates
author Chris Cannam
date Wed, 19 Sep 2018 15:42:22 +0100
parents a34a2a25907c
children
line wrap: on
line diff
--- a/layer/ScrollableImageCache.h	Mon Sep 17 13:51:31 2018 +0100
+++ b/layer/ScrollableImageCache.h	Wed Sep 19 15:42:22 2018 +0100
@@ -40,8 +40,7 @@
     ScrollableImageCache() :
         m_validLeft(0),
         m_validWidth(0),
-        m_startFrame(0),
-        m_zoomLevel(0)
+        m_startFrame(0)
     {}
 
     void invalidate() {
@@ -83,7 +82,7 @@
         return QRect(m_validLeft, 0, m_validWidth, m_image.height());
     }
     
-    int getZoomLevel() const {
+    ZoomLevel getZoomLevel() const {
         return m_zoomLevel;
     }
 
@@ -93,7 +92,8 @@
      * invalidate the cache here is the only thing the zoom level is
      * used for.)
      */
-    void setZoomLevel(int zoom) {
+    void setZoomLevel(ZoomLevel zoom) {
+        using namespace std::rel_ops;
         if (m_zoomLevel != zoom) {
             m_zoomLevel = zoom;
             invalidate();
@@ -157,7 +157,7 @@
     int m_validLeft;
     int m_validWidth;
     sv_frame_t m_startFrame;
-    int m_zoomLevel;
+    ZoomLevel m_zoomLevel;
 };
 
 #endif