diff layer/ScrollableImageCache.cpp @ 1122:94370157b265 spectrogram-minor-refactor

Fixes and debug output for mag range calculations
author Chris Cannam
date Fri, 22 Jul 2016 13:56:24 +0100
parents 175d4e15884d
children c53ed1a6fcbd
line wrap: on
line diff
--- a/layer/ScrollableImageCache.cpp	Fri Jul 22 12:17:55 2016 +0100
+++ b/layer/ScrollableImageCache.cpp	Fri Jul 22 13:56:24 2016 +0100
@@ -23,19 +23,19 @@
 ScrollableImageCache::scrollTo(const LayerGeometryProvider *v,
                                sv_frame_t newStartFrame)
 {
+    int dx = (v->getXForFrame(m_startFrame) -
+	      v->getXForFrame(newStartFrame));
+    
+#ifdef DEBUG_SCROLLABLE_IMAGE_CACHE
+    cerr << "ScrollableImageCache::scrollTo: start frame " << m_startFrame
+	 << " -> " << newStartFrame << ", dx = " << dx << endl;
+#endif
+
     if (m_startFrame == newStartFrame) {
 	// haven't moved
         return;
     }
 	
-    int dx = (v->getXForFrame(m_startFrame) -
-	      v->getXForFrame(newStartFrame));
-
-#ifdef DEBUG_SCROLLABLE_IMAGE_CACHE
-    cerr << "ScrollableImageCache::scrollTo: start frame " << m_startFrame
-	 << " -> " << newStartFrame << ", dx = " << dx << endl;
-#endif
-    
     m_startFrame = newStartFrame;
 	
     if (!isValid()) {