opt to round up on scaling so that 175% does 2x on Windows

This commit is contained in:
Ben Fry
2022-02-13 10:14:56 -05:00
parent fa741e29d0
commit c78f22ac3a
+6 -3
View File
@@ -10307,13 +10307,16 @@ public class PApplet implements PConstants {
if (uiScale == 0) {
int dpi = getWindowsDPI();
if (dpi != 0) {
uiScale = constrain(dpi / 96, 1, 2);
//uiScale = constrain(dpi / 96, 1, 2);
// If larger than 150% set scale to 2. Using scale 1 at 175% feels
// reeaally small. 150% is more of a tossup; it could also use 2.
uiScale = (dpi > 144) ? 2 : 1;
}
}
if (uiScale != 0) {
System.setProperty("sun.java2d.uiScale", String.valueOf(uiScale));
} else {
System.err.println("Could not identify Windows DPI, not setting sun.java2d.uiScale");
//} else {
//System.err.println("Could not identify Windows DPI, not setting sun.java2d.uiScale");
}
}