comparison view/ViewProxy.h @ 1353:86429ff00f05

Merge from branch zoom
author Chris Cannam
date Wed, 10 Oct 2018 08:44:27 +0100
parents 344f29e46258
children 28075cc658c9
comparison
equal deleted inserted replaced
1351:9fb7133dd818 1353:86429ff00f05
73 } 73 }
74 virtual bool getValueExtents(QString unit, double &min, double &max, 74 virtual bool getValueExtents(QString unit, double &min, double &max,
75 bool &log) const { 75 bool &log) const {
76 return m_view->getValueExtents(unit, min, max, log); 76 return m_view->getValueExtents(unit, min, max, log);
77 } 77 }
78 virtual int getZoomLevel() const { 78 virtual ZoomLevel getZoomLevel() const {
79 int z = m_view->getZoomLevel(); 79 ZoomLevel z = m_view->getZoomLevel();
80 //!!!
80 // cerr << "getZoomLevel: from " << z << " to "; 81 // cerr << "getZoomLevel: from " << z << " to ";
81 z = z / m_scaleFactor; 82 if (z.zone == ZoomLevel::FramesPerPixel) {
83 z.level /= m_scaleFactor;
84 if (z.level < 1) {
85 z.level = 1;
86 }
87 } else {
88 //!!!???
89 z.level *= m_scaleFactor;
90 }
82 // cerr << z << endl; 91 // cerr << z << endl;
83 if (z < 1) z = 1;
84 return z; 92 return z;
85 } 93 }
86 virtual QRect getPaintRect() const { 94 virtual QRect getPaintRect() const {
87 QRect r = m_view->getPaintRect(); 95 QRect r = m_view->getPaintRect();
88 return QRect(r.x() * m_scaleFactor, 96 return QRect(r.x() * m_scaleFactor,