Skip to content

Commit

Permalink
增加缩放比率的上下限
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Oct 10, 2019
1 parent 829cb14 commit 96dc827
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/windows/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ export function initManagerWindow() {

ipcMain.on('update-user-config', (event, config: MajsoulPlus.UserConfig) => {
updateObject(UserConfigs, config)
SaveConfigJson(config)

// 缩放比例的上下限
if (UserConfigs.window.zoomFactor < 0.2) {
UserConfigs.window.zoomFactor = 0.2
} else if (UserConfigs.window.zoomFactor > 10) {
UserConfigs.window.zoomFactor = 10
}
SaveConfigJson(UserConfigs)

ManagerWindow.setContentSize(
Global.ManagerWindowConfig.width * UserConfigs.window.zoomFactor,
Expand Down

0 comments on commit 96dc827

Please sign in to comment.