mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-15 03:53:16 +08:00
🚸 处理最大化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 窗口创建相关工具函数
|
||||
* @since Beta v0.9.1
|
||||
* @since Beta v0.9.6
|
||||
*/
|
||||
|
||||
import type { RenderCard } from "@comp/app/t-postcard.vue";
|
||||
@@ -101,7 +101,7 @@ export function getWindowSize(label: string): PhysicalSize {
|
||||
|
||||
/**
|
||||
* 窗口适配
|
||||
* @since Beta v0.9.1
|
||||
* @since Beta v0.9.6
|
||||
* @returns 无返回值
|
||||
*/
|
||||
export async function resizeWindow(): Promise<void> {
|
||||
@@ -118,6 +118,9 @@ export async function resizeWindow(): Promise<void> {
|
||||
const heightScale = screen.size.height / 1080;
|
||||
const targetWidth = Math.round(designSize.width * widthScale);
|
||||
const targetHeight = Math.round(designSize.height * heightScale);
|
||||
if (await windowCur.isMaximized()) {
|
||||
await windowCur.unmaximize();
|
||||
}
|
||||
await windowCur.setSize(new PhysicalSize(targetWidth, targetHeight));
|
||||
const targetZoom = Math.min(widthScale, heightScale) / (screen.scaleFactor * textScale);
|
||||
await windowCur.setZoom(targetZoom);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* vite 配置文件
|
||||
* @since Beta v0.9.1
|
||||
* @since Beta v0.9.6
|
||||
*/
|
||||
|
||||
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
// import postcssPresetEnv from "postcss-preset-env";
|
||||
import postcssPresetEnv from "postcss-preset-env";
|
||||
import { defineConfig } from "vite";
|
||||
import VueDevtools from "vite-plugin-vue-devtools";
|
||||
import vuetify from "vite-plugin-vuetify";
|
||||
@@ -57,17 +57,17 @@ export default defineConfig({
|
||||
chunkSizeWarningLimit: 8192,
|
||||
sourcemap: true,
|
||||
},
|
||||
// css: {
|
||||
// postcss: {
|
||||
// plugins: [
|
||||
// postcssPresetEnv({
|
||||
// stage: 2,
|
||||
// features: {
|
||||
// "color-function": true,
|
||||
// "cascade-layers": true,
|
||||
// },
|
||||
// }),
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: [
|
||||
postcssPresetEnv({
|
||||
stage: 2,
|
||||
features: {
|
||||
"color-function": true,
|
||||
"cascade-layers": true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user