Fix max and min zoom factor. Main window zoom buttons are always enabled.

This commit is contained in:
Luis Lucas
2014-03-23 19:30:43 +00:00
parent fc00a73144
commit 15382e8a6e
5 changed files with 24 additions and 15 deletions
+12 -2
View File
@@ -91,6 +91,12 @@ void ViewArea::clearMask()
m_mask.clear();
}
Double ViewArea::getZoomFactor()
{
return m_zoomFactor;
}
// QSize ViewArea::sizeHint() const
// {
// int w = m_pixmap.width()*m_zoomFactor;
@@ -103,6 +109,12 @@ void ViewArea::setZoomFactor( double f )
//if( f == m_zoomFactor )
//return;
if( f < ( 32.0 / m_pixmap.width() ) )
f = 32.0 / m_pixmap.width();
if( f > 10.0 )
f = 10.0;
m_zoomFactor = f;
//emit( zoomFactorChanged( m_zoomFactor ) );
@@ -423,8 +435,6 @@ void ViewArea::wheelEvent( QWheelEvent *event )
double f;
f = m_zoomFactor + 0.001 * event->delta();
if( f < ( 32.0 / m_pixmap.width() ) )
f = 32.0 / m_pixmap.width();
setZoomFactor( f );