comparison view/View.cpp @ 355:9aab6bd27fcc

...
author Chris Cannam
date Wed, 30 Jan 2008 14:43:05 +0000
parents 94ada7dbae3c
children 020c485aa7e0
comparison
equal deleted inserted replaced
354:94ada7dbae3c 355:9aab6bd27fcc
328 changeVisible = true; 328 changeVisible = true;
329 } 329 }
330 330
331 if (e) { 331 if (e) {
332 size_t rf = alignToReference(f); 332 size_t rf = alignToReference(f);
333 #ifdef DEBUG_VIEW_WIDGET_PAINT
333 std::cerr << "View[" << this << "]::setCentreFrame(" << f 334 std::cerr << "View[" << this << "]::setCentreFrame(" << f
334 << "): emitting centreFrameChanged(" 335 << "): emitting centreFrameChanged("
335 << rf << ")" << std::endl; 336 << rf << ")" << std::endl;
337 #endif
336 emit centreFrameChanged(rf, m_followPan, m_followPlay); 338 emit centreFrameChanged(rf, m_followPan, m_followPlay);
337 } 339 }
338 } 340 }
339 341
340 return changeVisible; 342 return changeVisible;
350 View::getFrameForX(int x) const 352 View::getFrameForX(int x) const
351 { 353 {
352 long z = (long)m_zoomLevel; 354 long z = (long)m_zoomLevel;
353 long frame = m_centreFrame - (width()/2) * z; 355 long frame = m_centreFrame - (width()/2) * z;
354 356
357 #ifdef DEBUG_VIEW_WIDGET_PAINT
355 std::cerr << "View::getFrameForX(" << x << "): z = " << z << ", m_centreFrame = " << m_centreFrame << ", width() = " << width() << ", frame = " << frame << std::endl; 358 std::cerr << "View::getFrameForX(" << x << "): z = " << z << ", m_centreFrame = " << m_centreFrame << ", width() = " << width() << ", frame = " << frame << std::endl;
359 #endif
356 360
357 frame = (frame / z) * z; // this is start frame 361 frame = (frame / z) * z; // this is start frame
358 return frame + x * z; 362 return frame + x * z;
359 } 363 }
360 364