From 48afb52ef1efdc8bdd6bd577be18a02a955de07f Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Fri, 4 Nov 2016 15:39:57 -0700 Subject: [PATCH 1/3] Fix for accelerometer simulator not working in firefox. Fixes Microsoft/pxt/#679 --- sim/visuals/microbit.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sim/visuals/microbit.ts b/sim/visuals/microbit.ts index d315fc12..0fe237c1 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -712,8 +712,9 @@ namespace pxsim.visuals { tiltDecayer = 0; } - let ax = (ev.clientX - this.element.clientWidth / 2) / (this.element.clientWidth / 3); - let ay = (ev.clientY - this.element.clientHeight / 2) / (this.element.clientHeight / 3); + let bbox = this.element.getBoundingClientRect(); + let ax = (ev.clientX - bbox.width / 2) / ( bbox.width / 3); + 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))); From 29eef560b0fcabbe00cab8e2cd79fd9cc48be140 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 7 Nov 2016 10:33:22 -0800 Subject: [PATCH 2/3] whitespace --- 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 0fe237c1..116ac6d9 100644 --- a/sim/visuals/microbit.ts +++ b/sim/visuals/microbit.ts @@ -713,7 +713,7 @@ namespace pxsim.visuals { } let bbox = this.element.getBoundingClientRect(); - let ax = (ev.clientX - bbox.width / 2) / ( bbox.width / 3); + let ax = (ev.clientX - bbox.width / 2) / (bbox.width / 3); let ay = (ev.clientY - bbox.height / 2) / (bbox.height / 3); let x = - Math.max(- 1023, Math.min(1023, Math.floor(ax * 1023))); From 1bc00f476c9e73791400a8e76820a14273f0b27c Mon Sep 17 00:00:00 2001 From: Owen Brotherwood Date: Mon, 7 Nov 2016 22:26:19 +0100 Subject: [PATCH 3/3] Requirement for node version used is not correct (#304) Consider referring to requirements for pxt to reduce time on updating all pxt dependants. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c518526..32f14b4a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The local server allows to run the editor and the documentation from your comput The following commands are a 1-time setup after synching the repo on your machine. -* if not yet installed, install [Node.js 4.4.5 or higher](https://nodejs.org/en/download/) +* See requirements for [pxt](https://github.com/Microsoft/pxt) * [clone this repo](https://help.github.com/articles/cloning-a-repository/) to your computer and go in the project folder ``` git clone https://github.com/microsoft/pxt-microbit