current params for new zone
Definition at line 1231 of file aimainwindow.cpp. 01232 { 01233 //check if threads is running 01234 if( m_threads.size() > 0 ) 01235 { 01236 if( m_threads[ 0 ]->isRunning() ) 01237 { 01238 QMessageBox::warning(this, tr("Threads"), tr("Current threads is running, please stop them before running a new threads!"), QMessageBox::Ok) ; 01239 return; 01240 } 01241 } 01242 01243 if( QMessageBox::Yes != QMessageBox::warning(this, tr("Zooming...") , tr("Are you sure to zooming this area?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) ) 01244 { 01245 return; 01246 } 01247 01248 int w = m_config->getImageWidth(); 01249 int h = m_config->getImageHeight(); 01250 01251 int minwh = w < h ? w : h; 01252 01253 m_viewX = m_viewX + ( m_zoom * ( startx < endx ? startx : endx ) / minwh ); 01254 m_viewY = m_viewY + ( m_zoom * ( starty < endy ? starty : endy ) / minwh ); 01255 double tmpX = static_cast<double>(abs( startx - endx )) / w ; 01256 double tmpY = static_cast<double>(abs( starty - endy )) / h ; 01257 01258 m_zoom = m_zoom * ( tmpX > tmpY ? tmpX : tmpY ) ; 01259 01260 this->runGenerator(); 01261 } |