Merge pull request #29 from Michaelangel007/master

Added 3x zoom for retina displays (From MichaelAngel007)
This commit is contained in:
Brendan Robert 2016-02-26 00:19:07 -06:00
commit b4ee1fafd8

View File

@ -391,29 +391,37 @@ public class EmulatorUILogic implements Reconfigurable {
@InvokableAction( @InvokableAction(
name = "Resize window", name = "Resize window",
category = "general", category = "general",
description = "Resize the screen to 1x/1.5x/2x video size", description = "Resize the screen to 1x/1.5x/2x/3x video size",
alternatives = "Adjust screen;Adjust window size;Adjust aspect ratio;Fix screen;Fix window size;Fix aspect ratio;Correct aspect ratio;", alternatives = "Adjust screen;Adjust window size;Adjust aspect ratio;Fix screen;Fix window size;Fix aspect ratio;Correct aspect ratio;",
defaultKeyMapping = {"ctrl+shift+a"}) defaultKeyMapping = {"ctrl+shift+a"})
public static void scaleIntegerRatio() { public static void scaleIntegerRatio() {
Platform.runLater(() -> { Platform.runLater(() -> {
JaceApplication.getApplication().primaryStage.setFullScreen(false); JaceApplication.getApplication().primaryStage.setFullScreen(false);
size++; size++;
if (size > 2) { if (size > 3) {
size = 0; size = 0;
} }
int width, height = 0; int width = 0, height = 0;
switch (size) { switch (size) {
case 0: case 0: // 1x
width = 560; width = 560;
height = 384; height = 384;
break; break;
case 1: case 1: // 1.5x
width = 840; width = 840;
height = 576; height = 576;
break; break;
default: case 2: // 2x
width = 1120; width = 560*2;
height = 768; height = 384*2;
break;
case 3: // 3x (retina) 2880x1800
width = 560*3;
height = 384*3;
break;
default: // 2x
width = 560*2;
height = 384*2;
} }
Stage stage = JaceApplication.getApplication().primaryStage; Stage stage = JaceApplication.getApplication().primaryStage;
double vgap = stage.getScene().getY(); double vgap = stage.getScene().getY();