Mercurial > hg > svgui
diff 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 |
line wrap: on
line diff
--- a/view/ViewProxy.h Wed Sep 19 15:42:22 2018 +0100 +++ b/view/ViewProxy.h Thu Sep 20 10:45:24 2018 +0100 @@ -75,12 +75,20 @@ bool &log) const { return m_view->getValueExtents(unit, min, max, log); } - virtual int getZoomLevel() const { - int z = m_view->getZoomLevel(); -// cerr << "getZoomLevel: from " << z << " to "; - z = z / m_scaleFactor; -// cerr << z << endl; - if (z < 1) z = 1; + virtual ZoomLevel getZoomLevel() const { + ZoomLevel z = m_view->getZoomLevel(); + //!!! + cerr << "getZoomLevel: from " << z << " to "; + if (z.zone == ZoomLevel::FramesPerPixel) { + z.level /= m_scaleFactor; + if (z.level < 1) { + z.level = 1; + } + } else { + //!!!??? + z.level *= m_scaleFactor; + } + cerr << z << endl; return z; } virtual QRect getPaintRect() const {