From 7e2251d8acf907d905b1384e5c86b63be85f0377 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 27 Dec 2017 20:35:36 -0800 Subject: [PATCH] Fix negative motor reporting --- sim/visuals/controls/motorReporter.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sim/visuals/controls/motorReporter.ts b/sim/visuals/controls/motorReporter.ts index b6c2fc3b..624fe6de 100644 --- a/sim/visuals/controls/motorReporter.ts +++ b/sim/visuals/controls/motorReporter.ts @@ -42,8 +42,7 @@ namespace pxsim.visuals { private updateSpeed(speed: number) { let c = Math.PI * (90 * 2); - if (speed < 0) speed = 100 - speed; - + speed = Math.abs(speed); let pct = ((100 - speed) / 100) * c; this.circleBar.setAttribute('stroke-dashoffset', `${pct}`); }