mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-12 14:26:09 -04:00
minor modification on the "Button with LED" shape
This commit is contained in:
parent
76e744afb2
commit
594f0ee2f3
@ -72,17 +72,17 @@ public class ButtonLEDShape extends ButtonShape {
|
||||
public void drawTo(Graphic graphic, Style heighLight) {
|
||||
super.drawTo(graphic, heighLight);
|
||||
|
||||
if (ledValue == null || ledValue.getBool()) {
|
||||
Vector center;
|
||||
if (button != null && button.isPressed()) {
|
||||
center = new Vector(-OUT_SIZE - 1, 0);
|
||||
} else
|
||||
center = new Vector(-OUT_SIZE - 1 - ButtonShape.HEIGHT, -ButtonShape.HEIGHT);
|
||||
boolean ledOn = ledValue == null || ledValue.getBool();
|
||||
boolean pressed = button != null && button.isPressed();
|
||||
|
||||
Vector center;
|
||||
if (pressed) {
|
||||
center = new Vector(-OUT_SIZE - 1, 0);
|
||||
} else
|
||||
center = new Vector(-OUT_SIZE - 1 - ButtonShape.HEIGHT, -ButtonShape.HEIGHT);
|
||||
|
||||
if (ledOn)
|
||||
graphic.drawCircle(center.add(-SIZE2, -SIZE2), center.add(SIZE2, SIZE2), color);
|
||||
graphic.drawCircle(center.add(-SIZE2, -SIZE2), center.add(SIZE2, SIZE2), Style.THIN);
|
||||
} else {
|
||||
Vector center = new Vector(-OUT_SIZE - 1 - ButtonShape.HEIGHT, -ButtonShape.HEIGHT);
|
||||
graphic.drawCircle(center.add(-SIZE2, -SIZE2), center.add(SIZE2, SIZE2), Style.THIN);
|
||||
}
|
||||
graphic.drawCircle(center.add(-SIZE2, -SIZE2), center.add(SIZE2, SIZE2), Style.THIN);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user