@@ -58,6 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
5858 :pages-scale =" getRenderPageScale(docIndex, pIndex)"
5959 :page-width =" getPageWidth(docIndex, pIndex)"
6060 :page-height =" getPageHeight(docIndex, pIndex)"
61+ :read-only =" readOnly"
6162 :on-update =" (payload) => updateObject(docIndex, object.id, payload)"
6263 :on-delete =" () => deleteObject(docIndex, object.id)"
6364 :on-drag-start =" (mouseX, mouseY, pointerOffset, dragShift) => startDraggingElement(docIndex, pIndex, object, mouseX, mouseY, pointerOffset, dragShift)"
@@ -183,6 +184,10 @@ export default {
183184 type: Boolean ,
184185 default: true ,
185186 },
187+ readOnly: {
188+ type: Boolean ,
189+ default: false ,
190+ },
186191 pageCountFormat: {
187192 type: String ,
188193 default: ' {currentPage} of {totalPages}' ,
@@ -222,6 +227,7 @@ export default {
222227 debouncedApplyZoom: null ,
223228 visualScale: this .initialScale ,
224229 autoFitApplied: false ,
230+ lastContainerWidth: 0 ,
225231 }
226232 },
227233 mounted () {
@@ -450,6 +456,14 @@ export default {
450456 if (this .isAddingMode || this .isDraggingElement ) {
451457 this .cachePageBounds ()
452458 }
459+ if (this .autoFitZoom && ! this .isAddingMode && ! this .isDraggingElement ) {
460+ const containerWidth = this .$el ? .clientWidth || 0
461+ if (containerWidth && containerWidth !== this .lastContainerWidth ) {
462+ this .lastContainerWidth = containerWidth
463+ this .autoFitApplied = false
464+ this .scheduleAutoFitZoom ()
465+ }
466+ }
453467 this .viewportRafId = 0
454468 })
455469 },
0 commit comments