Fix bug in ZoomtoFit.

This commit is contained in:
Luis Lucas committed 2014-03-29 21:25:30 +00:00
1 parent 9ca10be148
commit 4d380e6930
3 files changed
+11 -3

No files matched your search

+7 -1
View File
@@ -250,12 +250,18 @@ Void SubWindowHandle::zoomToFit()
scaleView( niceFit ); scaleView( niceFit );
} }
Void SubWindowHandle::scaleView( Double factor ) Void SubWindowHandle::scaleViewFactor( Double factor )
{ {
Q_ASSERT( m_cViewArea->image() ); Q_ASSERT( m_cViewArea->image() );
m_cViewArea->zoomChangeEvent( factor ); m_cViewArea->zoomChangeEvent( factor );
} }
Void SubWindowHandle::scaleView( Double scale )
{
Q_ASSERT( m_cViewArea->image() );
m_cViewArea->setZoomFactor( scale );
}
Void SubWindowHandle::scaleView( Int width, Int height ) Void SubWindowHandle::scaleView( Int width, Int height )
{ {
scaleView( QSize( width, height ) ); scaleView( QSize( width, height ) );
+3 -1
View File
@@ -106,7 +106,7 @@ public:
* @param factor factor of scale. Ex: 1.2 scale the image up by 20% and * @param factor factor of scale. Ex: 1.2 scale the image up by 20% and
* 0.8 scale the image down by 25% * 0.8 scale the image down by 25%
*/ */
Void scaleView( Double factor ); Void scaleView( Double scale );
/** /**
* The current image size is scaled to a rectangle as large as possible * The current image size is scaled to a rectangle as large as possible
@@ -121,6 +121,8 @@ public:
*/ */
Void scaleView( const QSize & size ); Void scaleView( const QSize & size );
Void scaleViewFactor( Double factor );
Double getScaleFactor() Double getScaleFactor()
{ {
return m_cViewArea->getZoomFactor(); return m_cViewArea->getZoomFactor();
+1 -1
View File
@@ -282,7 +282,7 @@ void plaYUVerApp::scaleFrame( int ratio )
{ {
if( activeSubWindow() ) if( activeSubWindow() )
{ {
activeSubWindow()->scaleView( ( Double )( ratio ) / 100.0 ); activeSubWindow()->scaleViewFactor( ( Double )( ratio ) / 100.0 );
// actionZoomIn->setEnabled( activeSubWindow()->getScaleFactor() < 3.0 ); // actionZoomIn->setEnabled( activeSubWindow()->getScaleFactor() < 3.0 );
// actionZoomOut->setEnabled( activeSubWindow()->getScaleFactor() > 0.333 ); // actionZoomOut->setEnabled( activeSubWindow()->getScaleFactor() > 0.333 );