merging master
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
namespace pxsim.motors {
|
||||
export function motorOn(power: number) {
|
||||
export function motorPower(power: number) {
|
||||
// TODO
|
||||
}
|
||||
export function motorCommand(command: MotorCommand) {
|
||||
|
||||
}
|
||||
export function dualMotorPower(motor: Motor, percent: number) {
|
||||
}
|
||||
}
|
||||
|
@ -1723,8 +1723,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)));
|
||||
|
Reference in New Issue
Block a user