mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-24 04:42:51 -04:00
minor refactoring
This commit is contained in:
parent
9d733a5bdd
commit
17fa2a6547
@ -2262,6 +2262,7 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
||||
}
|
||||
|
||||
private static final class RunToBreakRunnable implements Runnable {
|
||||
private static final int RUN_TIME_MS = 250;
|
||||
private final Model model;
|
||||
private final JLabel statusLabel;
|
||||
private int steps;
|
||||
@ -2279,7 +2280,7 @@ public final class Main extends JFrame implements ClosingWindowListener.ConfirmS
|
||||
Model.BreakInfo info = model.runToBreak(steps);
|
||||
time = System.currentTimeMillis() - time;
|
||||
if (time > 0) {
|
||||
int newSteps = (int) (steps * 250 / time);
|
||||
int newSteps = (int) (steps * RUN_TIME_MS / time);
|
||||
steps = (steps + newSteps) / 2;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user