mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
attempt to set ui scale on sketch startup (working on #378)
This commit is contained in:
@@ -10181,6 +10181,17 @@ public class PApplet implements PConstants {
|
||||
uncaughtThrowable = e;
|
||||
});
|
||||
|
||||
if (platform == WINDOWS) {
|
||||
// Set DPI scaling to either 1 or 2, but avoid fractional versions like
|
||||
// 125% and 250% that make things look gross, or even 300% since that
|
||||
// is not even a thing.
|
||||
int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
|
||||
System.out.println("dpi came back " + dpi);
|
||||
int scaleFactor = constrain(dpi / 96, 1, 2);
|
||||
System.out.println("setting scale factor to " + scaleFactor);
|
||||
System.setProperty("sun.java2d.uiscale", String.valueOf(scaleFactor));
|
||||
}
|
||||
|
||||
// This doesn't work, need to mess with Info.plist instead
|
||||
/*
|
||||
// In an exported application, add the Contents/Java folder to the
|
||||
|
||||
Reference in New Issue
Block a user