Merge pull request #1667 from xiaoyifang/opt/zoomfactor-range

opt: valid zoomfactor range from 0.25 to 5
This commit is contained in:
xiaoyifang 2024-07-10 18:02:59 +08:00 committed by GitHub
commit 029c09633b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3400,11 +3400,11 @@ void MainWindow::adjustCurrentZoomFactor()
{ {
if ( cfg.preferences.zoomFactor >= 5 ) if ( cfg.preferences.zoomFactor >= 5 )
cfg.preferences.zoomFactor = 5; cfg.preferences.zoomFactor = 5;
else if ( cfg.preferences.zoomFactor <= 0.1 ) else if ( cfg.preferences.zoomFactor <= 0.25 )
cfg.preferences.zoomFactor = 0.1; cfg.preferences.zoomFactor = 0.25;
zoomIn->setEnabled( cfg.preferences.zoomFactor < 5 ); zoomIn->setEnabled( cfg.preferences.zoomFactor < 5 );
zoomOut->setEnabled( cfg.preferences.zoomFactor > 0.1 ); zoomOut->setEnabled( cfg.preferences.zoomFactor > 0.25 );
zoomBase->setEnabled( !qFuzzyCompare( cfg.preferences.zoomFactor, 1.0 ) ); zoomBase->setEnabled( !qFuzzyCompare( cfg.preferences.zoomFactor, 1.0 ) );
} }