fix:page zoom bug

This commit is contained in:
黄云飞
2021-11-29 21:24:05 +08:00
parent 6bdeee99da
commit f92d5f56ce
2 changed files with 10 additions and 3 deletions
+8 -2
View File
@@ -258,8 +258,14 @@ export class CommandAdapt {
} }
public print() { public print() {
const { width, height } = this.options const { width, height, scale } = this.options
return printImageBase64(this.draw.getDataURL(), width, height) if (scale !== 1) {
this.draw.setPageScale(1)
}
printImageBase64(this.draw.getDataURL(), width, height)
if (scale !== 1) {
this.draw.setPageScale(scale)
}
} }
public pageScaleMinus() { public pageScaleMinus() {
+2 -1
View File
@@ -304,7 +304,8 @@ window.onload = function () {
} }
instance.listener.pageScaleChange = function (payload) { instance.listener.pageScaleChange = function (payload) {
document.querySelector<HTMLSpanElement>('.page-scale-percentage')!.innerText = `${Math.floor(payload * 100)}%` console.log('payload: ', payload);
document.querySelector<HTMLSpanElement>('.page-scale-percentage')!.innerText = `${Math.floor(payload * 10 * 10)}%`
} }
} }