|
|
@@ -35,7 +35,7 @@ const convertFontSizePtToPx = (html: string, ratio: number, autoFit: any) => {
|
|
|
if (autoFit?.fontScale && autoFit?.type == "text") { ratio = ratio * autoFit.fontScale / 100; }
|
|
|
// return html;
|
|
|
return html.replace(/\s*([\d.]+)pt/g, (match, p1) => {
|
|
|
- return `${(parseFloat(p1) * ratio - 1) | 0}px `
|
|
|
+ return `${(parseFloat(p1) * ratio) | 0}px `
|
|
|
})
|
|
|
|
|
|
}
|
|
|
@@ -783,6 +783,8 @@ export default () => {
|
|
|
}
|
|
|
|
|
|
let transparentPngBlob: Blob;
|
|
|
+ transparentPngBlob = pngBlob;
|
|
|
+ /*
|
|
|
if (alreadyTransparent) {
|
|
|
// 图片已有透明背景,直接使用原 PNG Blob
|
|
|
console.log('检测到透明背景,跳过白色变透明处理');
|
|
|
@@ -791,7 +793,7 @@ export default () => {
|
|
|
// 否则执行白色变透明处理
|
|
|
transparentPngBlob = await makeWhiteTransparentFromPng(pngBlob, tolerance);
|
|
|
}
|
|
|
-
|
|
|
+ */
|
|
|
const finalFilename = format === 'png' ? filename : filename.replace(/\.[^.]*$/, '') + '.png';
|
|
|
return new File([transparentPngBlob], finalFilename, { type: 'image/png' });
|
|
|
};
|
|
|
@@ -1720,7 +1722,7 @@ export default () => {
|
|
|
defaultColor: theme.value.fontColor,
|
|
|
content: convertFontSizePtToPx(el.content, ratio, el.autoFit),
|
|
|
style: getStyle(convertFontSizePtToPx(el.content, ratio, el.autoFit)),
|
|
|
- lineHeight: 1.15,
|
|
|
+ lineHeight: 1.5,
|
|
|
align: vAlignMap[el.vAlign] || 'middle',
|
|
|
outline: {
|
|
|
color: el.borderColor,
|