From 72806cfbad7d8f80f3e8f14a45185eb052951149 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 1 Oct 2022 22:54:02 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E4=BB=A5=E5=90=8E=E4=BF=9D=E8=AF=81=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=A4=A7=E5=B0=8F=20Fix=20https://github.com?= =?UTF-8?q?/siyuan-note/siyuan/issues/6041?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/electron/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/electron/main.js b/app/electron/main.js index 67845d9ad..7255242d0 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -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({