From 69b1a22a35c89cb3d1b52596c82ac566f285fbad Mon Sep 17 00:00:00 2001 From: Pylogmon Date: Mon, 22 May 2023 20:57:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=B0=E4=BD=8F?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=A4=A7=E5=B0=8F=E5=B0=BA=E5=AF=B8=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/Translator/components/TopBar/index.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/windows/Translator/components/TopBar/index.jsx b/src/windows/Translator/components/TopBar/index.jsx index 2bd6978c2e..28034c202a 100644 --- a/src/windows/Translator/components/TopBar/index.jsx +++ b/src/windows/Translator/components/TopBar/index.jsx @@ -19,12 +19,14 @@ let unlisten = listen('tauri://blur', () => { } }); -listen('tauri://resize', async (e) => { +listen('tauri://resize', async () => { if (get('remember_window_size') ?? false) { if (appWindow.label == 'translator' || appWindow.label == 'popclip' || appWindow.label == 'persistent') { - const size = e.payload; - await set('window_height', size.height); - await set('window_width', size.width); + const psize = await appWindow.innerSize(); + const factor = await appWindow.scaleFactor(); + const lsize = psize.toLogical(factor); + await set('window_height', parseInt(lsize.height)); + await set('window_width', parseInt(lsize.width)); } } });