Mercurial > hg > svgui
comparison view/ViewProxy.h @ 999:477fbf3f10ca tony-2.0-integration
At least avoid crashing if scaled zoom level reaches 0!
author | Chris Cannam |
---|---|
date | Thu, 20 Aug 2015 17:05:51 +0100 |
parents | 17cb48115d22 |
children | 4c8e7014abab |
comparison
equal
deleted
inserted
replaced
998:1a6304c547bf | 999:477fbf3f10ca |
---|---|
74 //!!! aarg, what if it's already 1? | 74 //!!! aarg, what if it's already 1? |
75 int z = m_view->getZoomLevel(); | 75 int z = m_view->getZoomLevel(); |
76 cerr << "getZoomLevel: from " << z << " to "; | 76 cerr << "getZoomLevel: from " << z << " to "; |
77 z = z / m_scaleFactor; | 77 z = z / m_scaleFactor; |
78 cerr << z << endl; | 78 cerr << z << endl; |
79 if (z < 1) z = 1; | |
79 return z; | 80 return z; |
80 } | 81 } |
81 virtual QRect getPaintRect() const { | 82 virtual QRect getPaintRect() const { |
82 QRect r = m_view->getPaintRect(); | 83 QRect r = m_view->getPaintRect(); |
83 return QRect(r.x() * m_scaleFactor, | 84 return QRect(r.x() * m_scaleFactor, |