Skip to content

Commit

Permalink
Option --scale now handled in the Java code, not in a wrapper.
Browse files Browse the repository at this point in the history
Resolves #513.
  • Loading branch information
bengtmartensson committed Dec 28, 2023
1 parent 6c4e325 commit 57ff86f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 1 addition & 8 deletions src/main/config/irscrutinizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
# When changing this file, or updating the programs, it may be a good idea to
# delete the property file, normally ~/.config/IrScrutinizer/properties.xml.

if [ "$1" = "-s" -o "$1" = "--scale" ] ; then
SCALE_FACTOR=$2
shift 2
fi

# Set to the preferred Java VM, with or without directory.
JAVA=${JAVA:-java}

# Modify for Hight DPI usage.
# Not all JVMs recognize this; some only accept integer arguments.
JVM_ARGS=-Dsun.java2d.uiScale=${SCALE_FACTOR:-1}
JVM_ARGS=

# Where the programs are installed, adjust if required
export IRSCRUTINIZERHOME="$(dirname -- "$(readlink -f -- "${0}")" )"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public static void main(String[] args) {
System.exit(IrpUtils.EXIT_SUCCESS);
}

if (commandLineArgs.scaling != null)
System.setProperty("sun.java2d.uiScale", commandLineArgs.scaling);

setupRadixPrefixes();

String applicationHome = Utils.findApplicationHome(commandLineArgs.applicationHome, IrScrutinizer.class, Version.appName);
Expand Down Expand Up @@ -209,6 +212,9 @@ private final static class CommandLineArgs {
@Parameter(names = {"-p", "--properties"}, description = "Pathname of properties file")
private String propertiesFilename = null;

@Parameter(names = {"-s", "--scale", "--scaling"}, description = "Set scaling of the GUI. Accepted values and their semantics depend on the JVM.")
private String scaling = null;

@Parameter(names = {"-V", "--version"}, description = "Display version information")
private boolean versionRequested;

Expand Down

0 comments on commit 57ff86f

Please sign in to comment.