diff --git a/src/editor/core/command/CommandAdapt.ts b/src/editor/core/command/CommandAdapt.ts index 45c6102..b11bcdf 100644 --- a/src/editor/core/command/CommandAdapt.ts +++ b/src/editor/core/command/CommandAdapt.ts @@ -258,8 +258,14 @@ export class CommandAdapt { } public print() { - const { width, height } = this.options - return printImageBase64(this.draw.getDataURL(), width, height) + const { width, height, scale } = this.options + if (scale !== 1) { + this.draw.setPageScale(1) + } + printImageBase64(this.draw.getDataURL(), width, height) + if (scale !== 1) { + this.draw.setPageScale(scale) + } } public pageScaleMinus() { diff --git a/src/main.ts b/src/main.ts index e3ee5f0..dab40e8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -304,7 +304,8 @@ window.onload = function () { } instance.listener.pageScaleChange = function (payload) { - document.querySelector('.page-scale-percentage')!.innerText = `${Math.floor(payload * 100)}%` + console.log('payload: ', payload); + document.querySelector('.page-scale-percentage')!.innerText = `${Math.floor(payload * 10 * 10)}%` } } \ No newline at end of file