Skip to content

Commit

Permalink
修复全屏比例错误
Browse files Browse the repository at this point in the history
  • Loading branch information
sonichy committed Sep 8, 2020
1 parent d4851be commit 7d9d8ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Binary file modified HTYMP
Binary file not shown.
9 changes: 3 additions & 6 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,9 @@ void MainWindow::on_action_scale2_triggered()
void MainWindow::fitDesktop()
{
if (isFullScreen()) {
float s;
if (widthV >= heightV) {
s = (float) QApplication::desktop()->width() / widthV;
} else {
s = (float) QApplication::desktop()->height() / heightV;
}
float s1 = (float) QApplication::desktop()->width() / widthV;
float s2 = (float) QApplication::desktop()->height() / heightV;
float s = qMin(s1, s2);
scene->setSceneRect(QRect(0, 0, widthV * s, heightV * s));
GVI->setSize(QSize(widthV * s, heightV * s));
}
Expand Down

0 comments on commit 7d9d8ec

Please sign in to comment.