MCPcopy Index your code
hub / github.com/benfry/processing4 / parseZoom

Method parseZoom

app/src/processing/app/ui/Toolkit.java:1093–1112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1091
1092
1093 static private float parseZoom() {
1094 if (Preferences.getBoolean("editor.zoom.auto")) {
1095 float newZoom = Platform.getSystemZoom();
1096 String percentSel = ((int) (newZoom*100)) + "%";
1097 Preferences.set("editor.zoom", percentSel);
1098 return newZoom;
1099
1100 } else {
1101 String zoomSel = Preferences.get("editor.zoom");
1102 if (zoomOptions.hasValue(zoomSel)) {
1103 // shave off the % symbol at the end
1104 zoomSel = zoomSel.substring(0, zoomSel.length() - 1);
1105 return PApplet.parseInt(zoomSel, 100) / 100f;
1106
1107 } else {
1108 Preferences.set("editor.zoom", "100%");
1109 return 1;
1110 }
1111 }
1112 }
1113
1114
1115 static BasicStroke zoomStroke;

Callers 1

zoomMethod · 0.95

Calls 6

getBooleanMethod · 0.95
getSystemZoomMethod · 0.95
setMethod · 0.95
getMethod · 0.95
parseIntMethod · 0.95
hasValueMethod · 0.45

Tested by

no test coverage detected