🎨 桌面端重启以后保证窗口最小大小 Fix https://github.com/siyuan-note/siyuan/issues/6041

This commit is contained in:
Liang Ding 2022-10-01 22:54:02 +08:00
parent c50679ec9e
commit 72806cfbad
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -149,10 +149,10 @@ const boot = () => {
windowState.width = Math.min(defaultWidth, workArea.width)
windowState.height = Math.min(defaultHeight, workArea.height)
}
if (x > workArea.width || x < 0) {
if (x > workArea.width) {
x = 0
}
if (y > workArea.height || y < 0) {
if (y > workArea.height) {
y = 0
}
}
@ -162,6 +162,12 @@ const boot = () => {
if (windowState.height < 300) {
windowState.height = 300
}
if (x < 0) {
x = 0
}
if (y < 0) {
y = 0
}
// 创建主窗体
mainWindow = new BrowserWindow({