mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-01 06:39:45 +08:00
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user