diff layer/ScrollableImageCache.cpp @ 1079:7ebfb61b1701 spectrogram-minor-refactor

More filling in render & cache code
author Chris Cannam
date Thu, 30 Jun 2016 15:46:14 +0100
parents 25b035362c44
children c8c747783110
line wrap: on
line diff
--- a/layer/ScrollableImageCache.cpp	Thu Jun 30 12:40:22 2016 +0100
+++ b/layer/ScrollableImageCache.cpp	Thu Jun 30 15:46:14 2016 +0100
@@ -23,6 +23,11 @@
 ScrollableImageCache::scrollTo(sv_frame_t newStartFrame)
 {
     if (!m_v) throw std::logic_error("ScrollableImageCache: not associated with a LayerGeometryProvider");
+
+    if (m_startFrame == newStartFrame) {
+	// haven't moved
+        return;
+    }
 	
     int dx = (m_v->getXForFrame(m_startFrame) -
 	      m_v->getXForFrame(newStartFrame));
@@ -41,7 +46,7 @@
     int w = m_image.width();
 
     if (dx == 0) {
-	// haven't moved
+	// haven't moved visibly
 	return;
     }