Revert "🐛 修复窗口适配异常"

This reverts commit 999ddc708c.
This commit is contained in:
BTMuli
2025-11-20 18:18:48 +08:00
parent 999ddc708c
commit 98c911469a
2 changed files with 46 additions and 35 deletions

View File

@@ -1,6 +1,7 @@
/**
* 窗口创建相关工具
* @since Beta v0.8.7
* @file utils/TGWindow.ts
* @description 窗口创建相关工具函数
* @since Beta v0.7.9
*/
import type { RenderCard } from "@comp/app/t-postcard.vue";
@@ -100,8 +101,8 @@ export function getWindowSize(label: string): PhysicalSize {
}
/**
* 窗口适配
* @since Beta v0.8.7
* @description 窗口适配
* @since Beta v0.7.9
* @returns Promise<void>
*/
export async function resizeWindow(): Promise<void> {
@@ -118,7 +119,7 @@ export async function resizeWindow(): Promise<void> {
const targetWidth = Math.round(designSize.width * widthScale);
const targetHeight = Math.round(designSize.height * heightScale);
await windowCur.setSize(new PhysicalSize(targetWidth, targetHeight));
const targetZoom = Math.min(widthScale, heightScale);
const targetZoom = Math.min(widthScale, heightScale) / screen.scaleFactor;
await windowCur.setZoom(targetZoom);
await windowCur.setFocus();
}