diff view/View.cpp @ 462:0a78c6b6ebc5

* 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 5f9a257598d8
children b77b79413cdb
line wrap: on
line diff
--- a/view/View.cpp	Mon Dec 08 13:06:44 2008 +0000
+++ b/view/View.cpp	Fri Dec 12 16:03:37 2008 +0000
@@ -441,6 +441,7 @@
 void
 View::setZoomLevel(size_t z)
 {
+    if (z < 1) z = 1;
     if (m_zoomLevel != int(z)) {
 	m_zoomLevel = z;
 	emit zoomLevelChanged(z, m_followZoom);