From dc9bfe793ae6ad49f38395fe9a7797805e239706 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Thu, 26 Oct 2023 23:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E5=8F=82=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=88=86=E4=BA=AB=E5=9B=BE?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/TGShare.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/TGShare.ts b/src/utils/TGShare.ts index fa276a81..850b3ced 100644 --- a/src/utils/TGShare.ts +++ b/src/utils/TGShare.ts @@ -75,7 +75,7 @@ function getShareImgBgColor(): string { /** * @description 生成分享截图 - * @since Beta v0.3.3 + * @since Beta v0.3.4 * @param {string} fileName - 文件名 * @param {HTMLElement} element - 元素 * @param {number} scale - 缩放比例 @@ -85,7 +85,7 @@ function getShareImgBgColor(): string { export async function generateShareImg( fileName: string, element: HTMLElement, - scale: number = 1.0, + scale: number = 0.98, offset: number = 30, ): Promise { const canvas = document.createElement("canvas"); @@ -103,7 +103,7 @@ export async function generateShareImg( canvas, x: (-offset / 2) * scale, y: (-offset / 2) * scale, - dpi: window.devicePixelRatio > 1 ? 300 : 96, + dpi: 350, }; const canvasData = await html2canvas(element, opts); try {