From 0f04ed8628449ed1910bb31bbb0e449736bea127 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 2 Aug 2019 16:45:47 +0900 Subject: [PATCH] Truncate angles --- desktop/sources/scripts/ronin.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/sources/scripts/ronin.js b/desktop/sources/scripts/ronin.js index 40e1e91..690f99b 100644 --- a/desktop/sources/scripts/ronin.js +++ b/desktop/sources/scripts/ronin.js @@ -158,19 +158,19 @@ function Ronin () { h: size.h } const wh = rect.w + ' ' + rect.h - const d = Math.sqrt(((line.a.x - line.b.x) * (line.a.x - line.b.x)) + ((line.a.y - line.b.y) * (line.a.y - line.b.y))) - const a = Math.atan2(pos.y - line.a.y, pos.x - line.a.x) + const d = Math.sqrt(((line.a.x - line.b.x) * (line.a.x - line.b.x)) + ((line.a.y - line.b.y) * (line.a.y - line.b.y))).toFixed(2) + const a = Math.atan2(pos.y - line.a.y, pos.x - line.a.x).toFixed(2) const circle = { cx: line.a.x, cy: line.a.y, - r: d.toFixed(2) + r: d } const arc = { cx: line.a.x, cy: line.a.y, - r: d.toFixed(2), + r: d, sa: 0, - ea: a.toFixed(2) + ea: a } return { x, y, xy, wh, d, a, line, rect, pos, size, circle, arc, type, 'is-down': type !== 'mouse-up' ? true : null } }