Skip to content

Commit ea907da

Browse files
authored
Merge pull request #10 from LibreSign/fix/apply-zoom-to-fit-when-add-documetn
fix: apply zoom to fit when add document
2 parents 687935a + fd0f844 commit ea907da

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/components/PDFElements.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@ export default {
294294
this.selectedDocIndex = 0
295295
this.selectedPageIndex = 0
296296
this.$emit('pdf-elements:end-init', { docsCount: docs.length })
297+
this.$nextTick(() => {
298+
if (this.autoFitZoom) {
299+
this.adjustZoomToFit()
300+
}
301+
})
297302
}
298303
},
299304
@@ -835,6 +840,10 @@ export default {
835840
if (Math.abs(optimalScale - this.scale) > 0.01) {
836841
this.scale = optimalScale
837842
this.visualScale = optimalScale
843+
this.pdfDocuments.forEach((doc) => {
844+
doc.pagesScale = doc.pagesScale.map(() => this.scale)
845+
})
846+
this.cachePageBounds()
838847
}
839848
},
840849
},

0 commit comments

Comments
 (0)