Skip to content

Commit

Permalink
Process negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
Feodor0090 authored Nov 2, 2022
1 parent 1e298d6 commit c1c89dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nmania/ui/ng/NumberBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ private final void PaintPad(Graphics g, int w, int y) {
int fh = num.getHeight();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
if(i == 3 && j == 0 && !allowNegative)
continue;
g.setColor(NmaniaDisplay.PINK_COLOR);
g.fillRoundRect(j*w/3 + 1, y, w/3 - 2, fh, fh, fh);
g.setColor(-1);
Expand Down Expand Up @@ -127,7 +129,8 @@ public void OnTouch(IDisplay d, int s, int x, int y, int dx, int dy, int w, int
y -= fh + 2;
if (y < fh + 2) {
if (x < w/3) {
OnKey(d, Canvas.KEY_STAR);
if (allowNegative)
OnKey(d, Canvas.KEY_STAR);
} else if (x < w*2/3) {
OnKey(d, '0');
} else {
Expand Down

0 comments on commit c1c89dd

Please sign in to comment.