From bde776ef401792dfc43c84a18a66e1d6e19e8c66 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 12 Jan 2023 18:56:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E7=BA=BF=E5=8A=9F=E8=83=BD=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/editor/PageLineEditor.vue | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/canvas/components/editor/PageLineEditor.vue b/frontend/src/components/canvas/components/editor/PageLineEditor.vue index b31c82cde0..fe582606eb 100644 --- a/frontend/src/components/canvas/components/editor/PageLineEditor.vue +++ b/frontend/src/components/canvas/components/editor/PageLineEditor.vue @@ -29,7 +29,7 @@ export default { return { baseLineKey: 'page-line-', lineLocations: [], - curLineHieght: 0, + curLineHeight: 0, clientStartY: 0, startTop: 0, movingLineHeight: 0, @@ -71,15 +71,15 @@ export default { this.scrollHeight = scrollHeight || document.getElementById('canvas-id-canvas-main').scrollHeight if (this.pdfPageLine?.proportion) { - this.curLineHieght = this.pdfPageLine.proportion * this.scrollHeight + this.curLineHeight = this.pdfPageLine.proportion * this.scrollHeight } else { - this.curLineHieght = this.windowHeight + this.curLineHeight = this.windowHeight this.saveLineHeight() } - let curLineLocation = this.curLineHieght + let curLineLocation = this.curLineHeight while (curLineLocation < this.scrollHeight) { this.lineLocations.push(curLineLocation) - curLineLocation += this.curLineHieght + curLineLocation += this.curLineHeight } }, handleMouseDown(e) { @@ -87,7 +87,7 @@ export default { this.startTop = parseInt(e.target.style.top) document.onmousemove = ev => this.handleMouseMove(e, ev) document.onmouseup = () => { - this.curLineHieght = this.movingLineHeight + this.curLineHeight = this.movingLineHeight this.saveLineHeight() this.init() document.onmousemove = document.onmouseup = null @@ -95,13 +95,13 @@ export default { }, handleMouseMove(e, ev) { const moveInstance = ev.clientY - this.clientStartY - this.movingLineHeight = this.curLineHieght + moveInstance + this.movingLineHeight = this.curLineHeight + moveInstance e.target.style.top = this.startTop + moveInstance + 'px' }, saveLineHeight() { this.$store.commit('canvasChange') - this.canvasStyleData.pdfPageLine.proportion = this.curLineHieght / this.scrollHeight - this.pdfPageLine.proportion = this.curLineHieght / this.scrollHeight + this.canvasStyleData.pdfPageLine.proportion = this.curLineHeight / this.scrollHeight + this.pdfPageLine.proportion = this.curLineHeight / this.scrollHeight } } }