Use setChangedState for touch and color sensors
This commit is contained in:
parent
a7d002d949
commit
d3dcb5de85
@ -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() {
|
||||
|
@ -14,8 +14,7 @@ namespace pxsim {
|
||||
|
||||
public setPressed(pressed: boolean) {
|
||||
this.pressed.push(pressed);
|
||||
this.changed = true;
|
||||
this.valueChanged = true;
|
||||
this.setChangedState();
|
||||
}
|
||||
|
||||
public isPressed() {
|
||||
|
@ -12,5 +12,9 @@ namespace pxsim.visuals {
|
||||
public getPaddingRatio() {
|
||||
return 1 / 8;
|
||||
}
|
||||
|
||||
public updateState() {
|
||||
// TODO: show different color modes
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user