From a782da9037c08660274763fdbf6bb07c02b6e228 Mon Sep 17 00:00:00 2001 From: JSR Date: Thu, 19 Mar 2026 21:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20macOS=20Retina=20=E4=B8=8B?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=B0=BA=E5=AF=B8=E5=BC=82=E5=B8=B8=E4=B8=8E?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=AA=97=E5=8F=A3=E8=BF=87=E5=B0=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands/window.rs | 5 ++++- src-tauri/src/lib.rs | 6 +++--- src-tauri/tauri.conf.json | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/commands/window.rs b/src-tauri/src/commands/window.rs index 843e6fa..4160333 100644 --- a/src-tauri/src/commands/window.rs +++ b/src-tauri/src/commands/window.rs @@ -126,7 +126,10 @@ pub async fn window_resize( #[cfg(desktop)] if let Some(window) = app.get_webview_window("main") { window - .set_size(tauri::Size::Physical(tauri::PhysicalSize { width, height })) + .set_size(tauri::Size::Logical(tauri::LogicalSize { + width: width as f64, + height: height as f64, + })) .map_err(|e| e.to_string())?; } Ok(()) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 944630d..b4fd264 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -298,9 +298,9 @@ fn setup_tray(_app: &mut App) -> Result<(), Box> { #[cfg(desktop)] fn setup_window_events(app: &mut App) -> Result<(), Box> { if let Some(window) = app.get_webview_window("main") { - let _ = window.set_size(tauri::Size::Physical(tauri::PhysicalSize { - width: 1180, - height: 680, + let _ = window.set_size(tauri::Size::Logical(tauri::LogicalSize { + width: 1180.0, + height: 680.0, })); let _ = window.center(); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2b5900b..3bade52 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -15,8 +15,8 @@ "windows": [ { "title": "SecScore", - "width": 10000, - "height": 10000, + "width": 1180, + "height": 680, "resizable": true, "fullscreen": false, "decorations": false,