fix:page zoom bug

pr675
黄云飞 4 years ago
parent 6bdeee99da
commit f92d5f56ce

@ -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() {

@ -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)}%`
} }
} }
Loading…
Cancel
Save