fix:page zoom bug
This commit is contained in:
@@ -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
@@ -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)}%`
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user