From 0c0c1cdd731bcdf7e46c48a8b148e5b2270a4476 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 6 Feb 2017 14:41:24 -0800 Subject: [PATCH] fix simulator y value --- sim/visuals/microbit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/visuals/microbit.ts b/sim/visuals/microbit.ts index 8a619f18..b79c398d 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -1728,7 +1728,7 @@ namespace pxsim.visuals { let ay = (ev.clientY - bbox.height / 2) / (bbox.height / 3); let x = - Math.max(- 1023, Math.min(1023, Math.floor(ax * 1023))); - let y = Math.max(- 1023, Math.min(1023, Math.floor(ay * 1023))); + let y = - Math.max(- 1023, Math.min(1023, Math.floor(ay * 1023))); let z2 = 1023 * 1023 - x * x - y * y; let z = Math.floor((z2 > 0 ? -1 : 1) * Math.sqrt(Math.abs(z2)));