Mercurial > hg > svgui
comparison view/ViewProxy.h @ 1326:97c68bffbda6 zoom
More ZoomLevel updates
author | Chris Cannam |
---|---|
date | Thu, 20 Sep 2018 10:45:24 +0100 |
parents | a34a2a25907c |
children | 344f29e46258 |
comparison
equal
deleted
inserted
replaced
1325:bc2cb82050a0 | 1326:97c68bffbda6 |
---|---|
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 // cerr << "getZoomLevel: from " << z << " to "; | 80 //!!! |
81 z = z / m_scaleFactor; | 81 cerr << "getZoomLevel: from " << z << " to "; |
82 // cerr << z << endl; | 82 if (z.zone == ZoomLevel::FramesPerPixel) { |
83 if (z < 1) z = 1; | 83 z.level /= m_scaleFactor; |
84 if (z.level < 1) { | |
85 z.level = 1; | |
86 } | |
87 } else { | |
88 //!!!??? | |
89 z.level *= m_scaleFactor; | |
90 } | |
91 cerr << z << endl; | |
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, |