Mercurial > hg > svgui
comparison view/View.cpp @ 1352:4949061fcb8c zoom
Debug tweaks
author | Chris Cannam |
---|---|
date | Fri, 05 Oct 2018 09:59:41 +0100 |
parents | 5f3e374746b6 |
children | 86429ff00f05 |
comparison
equal
deleted
inserted
replaced
1349:615eb28768ca | 1352:4949061fcb8c |
---|---|
45 | 45 |
46 #include <iostream> | 46 #include <iostream> |
47 #include <cassert> | 47 #include <cassert> |
48 #include <cmath> | 48 #include <cmath> |
49 | 49 |
50 #define DEBUG_VIEW 1 | 50 //#define DEBUG_VIEW 1 |
51 //#define DEBUG_VIEW_WIDGET_PAINT 1 | 51 //#define DEBUG_VIEW_WIDGET_PAINT 1 |
52 | 52 |
53 View::View(QWidget *w, bool showProgress) : | 53 View::View(QWidget *w, bool showProgress) : |
54 QFrame(w), | 54 QFrame(w), |
55 m_id(getNextId()), | 55 m_id(getNextId()), |
425 --fdiff; // round to the left | 425 --fdiff; // round to the left |
426 } | 426 } |
427 result = fdiff + m_centreFrame; | 427 result = fdiff + m_centreFrame; |
428 } | 428 } |
429 | 429 |
430 #ifdef DEBUG_VIEW | |
430 if (x == 0) { | 431 if (x == 0) { |
431 SVCERR << "getFrameForX(" << x << "): diff = " << diff << ", fdiff = " | 432 SVCERR << "getFrameForX(" << x << "): diff = " << diff << ", fdiff = " |
432 << fdiff << ", m_centreFrame = " << m_centreFrame | 433 << fdiff << ", m_centreFrame = " << m_centreFrame |
433 << ", level = " << m_zoomLevel.level | 434 << ", level = " << m_zoomLevel.level |
434 << ", diff % level = " << (diff % m_zoomLevel.level) | 435 << ", diff % level = " << (diff % m_zoomLevel.level) |
435 << ", nominal " << fdiff + m_centreFrame | 436 << ", nominal " << fdiff + m_centreFrame |
436 << ", will return " << result | 437 << ", will return " << result |
437 << endl; | 438 << endl; |
438 } | 439 } |
439 | 440 #endif |
441 | |
440 return result; | 442 return result; |
441 } | 443 } |
442 | 444 |
443 double | 445 double |
444 View::getYForFrequency(double frequency, | 446 View::getYForFrequency(double frequency, |