comparison 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
comparison
equal deleted inserted replaced
461:272e58f0bf8b 462:0a78c6b6ebc5
439 } 439 }
440 440
441 void 441 void
442 View::setZoomLevel(size_t z) 442 View::setZoomLevel(size_t z)
443 { 443 {
444 if (z < 1) z = 1;
444 if (m_zoomLevel != int(z)) { 445 if (m_zoomLevel != int(z)) {
445 m_zoomLevel = z; 446 m_zoomLevel = z;
446 emit zoomLevelChanged(z, m_followZoom); 447 emit zoomLevelChanged(z, m_followZoom);
447 update(); 448 update();
448 } 449 }