From d7a5a314db8a353f7348cff07c0f1c8463e84f58 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 16 Nov 2024 22:54:40 -0300 Subject: [PATCH] fix: drawing ration Signed-off-by: Vitor Mattos --- src/Components/Drawing.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Components/Drawing.vue b/src/Components/Drawing.vue index f5c83da..073c5a0 100644 --- a/src/Components/Drawing.vue +++ b/src/Components/Drawing.vue @@ -69,6 +69,7 @@ export default { dx: 0, dy: 0, dw: 0, + dh: 0, direction: '', // ratio: this.originWidth / this.originHeight, } @@ -117,6 +118,7 @@ export default { let d = -Infinity d = Math.max(_dx, _dy * this.ratio) this.dw = d + this.dh = d / this.ratio } } }, @@ -143,11 +145,13 @@ export default { x: this.x + this.dx, y: this.y + this.dy, width: this.width + this.dw, + height: this.height + this.dh, scale: (this.width + this.dw) / this.originWidth, }) this.dx = 0 this.dy = 0 this.dw = 0 + this.dh = 0 this.direction = '' } this.operation = ''