Skip to content

Commit

Permalink
🎨 参数调整,修复分享图模糊问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Oct 26, 2023
1 parent 9e42706 commit dc9bfe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/TGShare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 - 缩放比例
Expand All @@ -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<void> {
const canvas = document.createElement("canvas");
Expand All @@ -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 {
Expand Down

0 comments on commit dc9bfe7

Please sign in to comment.