summaryrefslogtreecommitdiff
path: root/enigma-swing/src/main/java/cuchaz
diff options
context:
space:
mode:
authorGravatar modmuss502021-03-19 18:39:05 +0000
committerGravatar modmuss502021-03-19 18:39:05 +0000
commit923e2300e65e8f958a694d4e83041f116b7c4775 (patch)
tree828c89180b72b04635a031e90d43eaabfdf2a476 /enigma-swing/src/main/java/cuchaz
parentBump version (diff)
downloadenigma-923e2300e65e8f958a694d4e83041f116b7c4775.tar.gz
enigma-923e2300e65e8f958a694d4e83041f116b7c4775.tar.xz
enigma-923e2300e65e8f958a694d4e83041f116b7c4775.zip
WIP full record support
Diffstat (limited to 'enigma-swing/src/main/java/cuchaz')
-rw-r--r--enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java
index 828da116..bfa2f389 100644
--- a/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java
+++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java
@@ -258,7 +258,15 @@ public final class UiConfig {
258 OptionalInt x = section.getInt(String.format("X %s", screenSize.width)); 258 OptionalInt x = section.getInt(String.format("X %s", screenSize.width));
259 OptionalInt y = section.getInt(String.format("Y %s", screenSize.height)); 259 OptionalInt y = section.getInt(String.format("Y %s", screenSize.height));
260 if (x.isPresent() && y.isPresent()) { 260 if (x.isPresent() && y.isPresent()) {
261 return new Point(x.getAsInt(), y.getAsInt()); 261 int ix = x.getAsInt();
262 int iy = y.getAsInt();
263
264 // Ensure that the position is on the screen.
265 if (ix < 0 || iy < 0 || ix > screenSize.width || iy > screenSize.height) {
266 return fallback;
267 }
268
269 return new Point(ix, iy);
262 } else { 270 } else {
263 return fallback; 271 return fallback;
264 } 272 }