Mercurial > hg > svapp
diff framework/MainWindowBase.cpp @ 150:6e8bce502be3
* Avoid crash when zooming-to-fit a very short file! (Of course, we
can't actually make a very short file zoom to fit as we don't permit
close enough zoom resolution, but best not to crash, hey?)
author | Chris Cannam |
---|---|
date | Fri, 12 Dec 2008 16:03:37 +0000 |
parents | 7dca51571320 |
children | 6f1e64670451 |
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp Thu Dec 11 11:03:14 2008 +0000 +++ b/framework/MainWindowBase.cpp Fri Dec 12 16:03:37 2008 +0000 @@ -1787,6 +1787,7 @@ if (pixels > 4) pixels -= 4; size_t zoomLevel = (end - start) / pixels; + if (zoomLevel < 1) zoomLevel = 1; currentPane->setZoomLevel(zoomLevel); currentPane->setCentreFrame((start + end) / 2);