changeset 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 272e58f0bf8b
children 1461cfc7e446
files view/View.cpp
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
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);