Use setChangedState for touch and color sensors

This commit is contained in:
Sam El-Husseini 2017-12-19 17:01:45 -08:00
parent a7d002d949
commit d3dcb5de85
3 changed files with 10 additions and 6 deletions

View File

@ -29,11 +29,12 @@ namespace pxsim {
getDeviceType() {
return DAL.DEVICE_TYPE_COLOR;
}
setColor(color: number) {
this.color = color;
this.changed = true;
this.valueChanged = true;
if (this.color != color) {
this.color = color;
this.setChangedState();
}
}
getValue() {

View File

@ -14,8 +14,7 @@ namespace pxsim {
public setPressed(pressed: boolean) {
this.pressed.push(pressed);
this.changed = true;
this.valueChanged = true;
this.setChangedState();
}
public isPressed() {

View File

@ -12,5 +12,9 @@ namespace pxsim.visuals {
public getPaddingRatio() {
return 1 / 8;
}
public updateState() {
// TODO: show different color modes
}
}
}