diff --git a/src/Components/TextItem.vue b/src/Components/TextItem.vue index ee156c3..82428b5 100644 --- a/src/Components/TextItem.vue +++ b/src/Components/TextItem.vue @@ -164,6 +164,8 @@ export default { // editable: null, dx: 0, dy: 0, + width: 0, + height: 0, operation: '', size_: this.size, lineHeight_: this.lineHeight, @@ -233,6 +235,8 @@ export default { this.operation = '' }, handlePanStart(event) { + this.width = this.$refs.editable.offsetWidth + this.height = this.$refs.editable.offsetHeight let coordinate if (event.type === 'mousedown') { coordinate = this.handleMousedown(event) diff --git a/src/VuePdfEditor.vue b/src/VuePdfEditor.vue index 9560208..be3ee6a 100644 --- a/src/VuePdfEditor.vue +++ b/src/VuePdfEditor.vue @@ -151,6 +151,8 @@ :text="object.text" :x="object.x" :y="object.y" + :width="object.width" + :height="object.height" :show-line-size-select="showLineSizeSelect" :show-font-size-select="showFontSizeSelect" :show-font-select="showFontSelect" @@ -595,7 +597,6 @@ export default { text, type: 'text', size: this.textDefaultSize, - width: 0, // recalculate after editing lineHeight: 1.4, fontFamily: this.currentFont, pageWidth: this.pageSizes[currentPage + 1].width,