removing cancel animation stuff

This commit is contained in:
Peli de Halleux 2017-12-19 16:21:14 -08:00
parent c8ac770983
commit 7123bfecd3
2 changed files with 0 additions and 6 deletions

View File

@ -5,8 +5,6 @@ namespace pxsim.visuals {
private static ROTATING_ECLIPSE_ID = "1eb2ae58-2419-47d4-86bf-4f26a7f0cf61"; private static ROTATING_ECLIPSE_ID = "1eb2ae58-2419-47d4-86bf-4f26a7f0cf61";
private lastMotorAnimationId: any;
constructor(port: number) { constructor(port: number) {
super(LARGE_MOTOR_SVG, "large-motor", NodeType.LargeMotor, port); super(LARGE_MOTOR_SVG, "large-motor", NodeType.LargeMotor, port);
} }
@ -15,7 +13,6 @@ namespace pxsim.visuals {
const motorState = ev3board().getMotors()[this.port]; const motorState = ev3board().getMotors()[this.port];
if (!motorState) return; if (!motorState) return;
const speed = motorState.getSpeed(); const speed = motorState.getSpeed();
if (this.lastMotorAnimationId) cancelAnimationFrame(this.lastMotorAnimationId);
if (!speed) return; if (!speed) return;
this.setMotorAngle(motorState.getAngle()); this.setMotorAngle(motorState.getAngle());

View File

@ -11,8 +11,6 @@ namespace pxsim.visuals {
private hasPreviousAngle: boolean; private hasPreviousAngle: boolean;
private previousAngle: number; private previousAngle: number;
private lastMotorAnimationId: any;
constructor(port: number) { constructor(port: number) {
super(MEDIUM_MOTOR_SVG, "medium-motor", NodeType.MediumMotor, port); super(MEDIUM_MOTOR_SVG, "medium-motor", NodeType.MediumMotor, port);
} }
@ -25,7 +23,6 @@ namespace pxsim.visuals {
const motorState = ev3board().getMotors()[this.port]; const motorState = ev3board().getMotors()[this.port];
if (!motorState) return; if (!motorState) return;
const speed = motorState.getSpeed(); const speed = motorState.getSpeed();
if (this.lastMotorAnimationId) cancelAnimationFrame(this.lastMotorAnimationId);
if (!speed) return; if (!speed) return;
this.setMotorAngle(motorState.getAngle()); this.setMotorAngle(motorState.getAngle());