@@ -11,7 +11,6 @@ import { sep } from "@tauri-apps/api/path";
1111import { save } from "@tauri-apps/plugin-dialog" ;
1212import { writeFile } from "@tauri-apps/plugin-fs" ;
1313import { platform } from "@tauri-apps/plugin-os" ;
14- import { snapdom } from "@zumer/snapdom" ;
1514import html2canvas from "html2canvas" ;
1615import { storeToRefs } from "pinia" ;
1716
@@ -85,33 +84,6 @@ function getShareImgBgColor(): string {
8584 return "#f9f6f2" ;
8685}
8786
88- /**
89- * @description 开发环境生成分享截图
90- * @since Beta v0.7.7
91- * @see https://github.com/zumerlab/snapdom
92- * @param {string } fileName - 文件名
93- * @param {HTMLElement } element - 元素
94- * @param {number } scale - 缩放比例
95- * @returns {Promise<void> } 无返回值
96- */
97- async function genShareImgDev (
98- fileName : string ,
99- element : HTMLElement ,
100- scale : number = 1.2 ,
101- ) : Promise < void > {
102- const bgColor = getShareImgBgColor ( ) ;
103- await snapdom . download ( element , {
104- scale : scale ,
105- backgroundColor : bgColor ,
106- embedFonts : true ,
107- format : "webp" ,
108- filename : fileName ,
109- compress : false ,
110- quality : 1 ,
111- dpr : 1 ,
112- } ) ;
113- }
114-
11587/**
11688 * @description 生成分享截图
11789 * @since Beta v0.7.7
@@ -127,12 +99,6 @@ export async function generateShareImg(
12799 scale : number = 1.2 ,
128100 scrollable : boolean = false ,
129101) : Promise < void > {
130- if ( import . meta. env . DEV ) {
131- if ( Math . random ( ) < 0.1 ) {
132- await genShareImgDev ( fileName , element , scale ) ;
133- }
134- return ;
135- }
136102 const canvas = document . createElement ( "canvas" ) ;
137103 const maxHeight = element . style . maxHeight ;
138104 if ( scrollable ) element . style . maxHeight = "100%" ;
0 commit comments