diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index ef2a446e..bbf666ad 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -418,8 +418,10 @@ public class Options { RES_800_600 (800, 600), RES_1024_600 (1024, 600), RES_1024_768 (1024, 768), + RES_1280_720 (1280, 720), RES_1280_800 (1280, 800), RES_1280_960 (1280, 960), + RES_1280_1024 (1280, 1024), RES_1366_768 (1366, 768), RES_1440_900 (1440, 900), RES_1600_900 (1600, 900), @@ -428,7 +430,9 @@ public class Options { RES_1920_1080 (1920, 1080), RES_1920_1200 (1920, 1200), RES_2560_1440 (2560, 1440), - RES_2560_1600 (2560, 1600); + RES_2560_1600 (2560, 1600), + RES_3840_2160 (3840, 2160); + /** Screen dimensions. */ private int width, height; diff --git a/src/itdelatrisu/opsu/OsuFile.java b/src/itdelatrisu/opsu/OsuFile.java index 39d888f7..11a8c03d 100644 --- a/src/itdelatrisu/opsu/OsuFile.java +++ b/src/itdelatrisu/opsu/OsuFile.java @@ -268,14 +268,20 @@ public class OsuFile implements Comparable { bgImageMap.put(this, bgImage); } - // fit image to screen int swidth = width; int sheight = height; if (!stretch) { + // fit image to screen if (bgImage.getWidth() / (float) bgImage.getHeight() > width / (float) height) // x > y sheight = (int) (width * bgImage.getHeight() / (float) bgImage.getWidth()); else swidth = (int) (height * bgImage.getWidth() / (float) bgImage.getHeight()); + } else { + //fill image to screen while keeping aspect ratio + if (bgImage.getWidth() / (float) bgImage.getHeight() > width / (float) height) // x > y + swidth = (int) (height * bgImage.getWidth() / (float) bgImage.getHeight()); + else + sheight = (int) (width * bgImage.getHeight() / (float) bgImage.getWidth()); } bgImage = bgImage.getScaledCopy(swidth, sheight);