From 503a869b13b85c6a30c3b0768555dd82678b3cbd Mon Sep 17 00:00:00 2001 From: BTMuli Date: Tue, 19 May 2026 18:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BD=8D=E7=BD=AE=E5=8F=96?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=BC=82=E5=B8=B8=E5=AF=BC=E8=87=B4=E7=9A=84=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/utils/TGWindow.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/TGWindow.ts b/src/utils/TGWindow.ts index c9b205cd..6e182ad0 100644 --- a/src/utils/TGWindow.ts +++ b/src/utils/TGWindow.ts @@ -1,6 +1,6 @@ /** * 窗口创建相关工具函数 - * @since Beta v0.9.8 + * @since Beta v0.10.2 */ import type { RenderCard } from "@comp/app/t-postcard.vue"; @@ -101,7 +101,7 @@ export function getWindowSize(label: string): PhysicalSize { /** * 判断窗口位置,确保窗口不超出屏幕并居中 - * @since Beta v0.9.8 + * @since Beta v0.10.2 * @remarks 当窗口超出屏幕时回滚到 resizeWindow,此时回正配置默认生效 * @returns 无返回值 */ @@ -124,11 +124,11 @@ export async function setWindowPos(): Promise { await resizeWindow(); await windowCur.center(); } else if (targetHeight > cpHeight) { - const left = (screen.size.width - targetWidth) / 2; + const left = Math.round((screen.size.width - targetWidth) / 2); await windowCur.setSize(new PhysicalSize(targetWidth, targetHeight)); await windowCur.setPosition(new PhysicalPosition(left, 24)); } else if (targetWidth > screen.size.width) { - const top = (screen.size.height - targetHeight) / 2; + const top = Math.round((screen.size.height - targetHeight) / 2); await windowCur.setSize(new PhysicalSize(targetWidth, targetHeight)); await windowCur.setPosition(new PhysicalPosition(24, top)); } else {