comparison 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
comparison
equal deleted inserted replaced
1121:d930ff725f64 1122:94370157b265
21 21
22 void 22 void
23 ScrollableImageCache::scrollTo(const LayerGeometryProvider *v, 23 ScrollableImageCache::scrollTo(const LayerGeometryProvider *v,
24 sv_frame_t newStartFrame) 24 sv_frame_t newStartFrame)
25 { 25 {
26 int dx = (v->getXForFrame(m_startFrame) -
27 v->getXForFrame(newStartFrame));
28
29 #ifdef DEBUG_SCROLLABLE_IMAGE_CACHE
30 cerr << "ScrollableImageCache::scrollTo: start frame " << m_startFrame
31 << " -> " << newStartFrame << ", dx = " << dx << endl;
32 #endif
33
26 if (m_startFrame == newStartFrame) { 34 if (m_startFrame == newStartFrame) {
27 // haven't moved 35 // haven't moved
28 return; 36 return;
29 } 37 }
30 38
31 int dx = (v->getXForFrame(m_startFrame) -
32 v->getXForFrame(newStartFrame));
33
34 #ifdef DEBUG_SCROLLABLE_IMAGE_CACHE
35 cerr << "ScrollableImageCache::scrollTo: start frame " << m_startFrame
36 << " -> " << newStartFrame << ", dx = " << dx << endl;
37 #endif
38
39 m_startFrame = newStartFrame; 39 m_startFrame = newStartFrame;
40 40
41 if (!isValid()) { 41 if (!isValid()) {
42 return; 42 return;
43 } 43 }