From 34871b73442929bd7af1b4e73d438ddd349592d8 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Fri, 13 May 2022 20:54:52 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AF=BC=E5=87=BAPPTX=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=88=E8=A1=8C=E9=AB=98=E3=80=81=E6=AE=B5=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useExport.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/useExport.ts b/src/hooks/useExport.ts index daae6ac3..01213683 100644 --- a/src/hooks/useExport.ts +++ b/src/hooks/useExport.ts @@ -176,10 +176,12 @@ export default () => { if (bulletFlag && styleObj['list-type'] === 'ol') { options.bullet = { type: 'number', indent: 20 * 0.75 } + options.paraSpaceBefore = 0.1 bulletFlag = false } if (bulletFlag && styleObj['list-type'] === 'ul') { options.bullet = { indent: 20 * 0.75 } + options.paraSpaceBefore = 0.1 bulletFlag = false } @@ -374,13 +376,15 @@ export default () => { fontSize: 20 * 0.75, fontFace: '微软雅黑', color: '#000000', - valign: 'middle', + valign: 'top', margin: 10 * 0.75, - lineSpacingMultiple: 1.5 / 1.2, + paraSpaceBefore: 5 * 0.75, + lineSpacingMultiple: 1.5 / 1.25, + autoFit: true, } if (el.rotate) options.rotate = el.rotate if (el.wordSpace) options.charSpacing = el.wordSpace * 0.75 - if (el.lineHeight) options.lineSpacingMultiple = el.lineHeight / 1.2 + if (el.lineHeight) options.lineSpacingMultiple = el.lineHeight / 1.25 if (el.fill) { const c = formatColor(el.fill) const opacity = el.opacity === undefined ? 1 : el.opacity @@ -496,6 +500,7 @@ export default () => { fontSize: 20 * 0.75, fontFace: '微软雅黑', color: '#000000', + paraSpaceBefore: 5 * 0.75, valign: el.text.align, } if (el.rotate) options.rotate = el.rotate