Skip to content

Commit 1adaca1

Browse files
authored
Merge pull request #113 from LibreSign/fix/drawing-ratio
fix: drawing ration
2 parents 0c4cb08 + d7a5a31 commit 1adaca1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Components/Drawing.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export default {
7171
dx: 0,
7272
dy: 0,
7373
dw: 0,
74+
dh: 0,
7475
direction: '',
7576
// ratio: this.originWidth / this.originHeight,
7677
}
@@ -119,6 +120,7 @@ export default {
119120
let d = -Infinity
120121
d = Math.max(_dx, _dy * this.ratio)
121122
this.dw = d
123+
this.dh = d / this.ratio
122124
}
123125
}
124126
},
@@ -145,11 +147,13 @@ export default {
145147
x: coordinate.detail.x,
146148
y: coordinate.detail.y,
147149
width: this.width + this.dw,
150+
height: this.height + this.dh,
148151
scale: (this.width + this.dw) / this.originWidth,
149152
})
150153
this.dx = 0
151154
this.dy = 0
152155
this.dw = 0
156+
this.dh = 0
153157
this.direction = ''
154158
}
155159
this.operation = ''

0 commit comments

Comments
 (0)