Skip to content

Commit d7a5a31

Browse files
committed
fix: drawing ration
Signed-off-by: Vitor Mattos <[email protected]>
1 parent f5c8448 commit d7a5a31

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
@@ -69,6 +69,7 @@ export default {
6969
dx: 0,
7070
dy: 0,
7171
dw: 0,
72+
dh: 0,
7273
direction: '',
7374
// ratio: this.originWidth / this.originHeight,
7475
}
@@ -117,6 +118,7 @@ export default {
117118
let d = -Infinity
118119
d = Math.max(_dx, _dy * this.ratio)
119120
this.dw = d
121+
this.dh = d / this.ratio
120122
}
121123
}
122124
},
@@ -143,11 +145,13 @@ export default {
143145
x: this.x + this.dx,
144146
y: this.y + this.dy,
145147
width: this.width + this.dw,
148+
height: this.height + this.dh,
146149
scale: (this.width + this.dw) / this.originWidth,
147150
})
148151
this.dx = 0
149152
this.dy = 0
150153
this.dw = 0
154+
this.dh = 0
151155
this.direction = ''
152156
}
153157
this.operation = ''

0 commit comments

Comments
 (0)