changeset 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 b774a451b093
children f8110d1a3a37
files framework/MainWindowBase.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
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);