Skip to content

Commit 61811bc

Browse files
committed
perf: update win size default
1 parent 9345b8b commit 61811bc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src-tauri/src/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ fn restore_window_size(win: &WebviewWindow) -> Result<(), String> {
274274
return Ok(());
275275
};
276276

277-
// 避免设置到 0 或负数
278-
let w = width_logical.max(1.0);
279-
let h = height_logical.max(1.0);
277+
// 限制窗口尺寸:宽度 600-1800,高度 400-1000
278+
let w = width_logical.max(600.0).min(1800.0);
279+
let h = height_logical.max(400.0).min(1000.0);
280280

281281
win.set_size(tauri::Size::Logical(LogicalSize::new(w, h)))
282282
.map_err(|e| format!("set_size failed: {}", e))?;

0 commit comments

Comments
 (0)