Skip to content

Commit f5f478c

Browse files
committed
Factored out method to save sketch location
1 parent c98c180 commit f5f478c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/src/processing/app/Base.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,19 @@ protected void storeSketches() {
574574
if (path.startsWith(untitledPath) && !sketch.isModified()) {
575575
continue;
576576
}
577-
PreferencesData.set("last.sketch" + index + ".path", path);
578-
579-
int[] placement = editor.getPlacement();
580-
String location = PApplet.join(PApplet.str(placement), ",");
581-
PreferencesData.set("last.sketch" + index + ".location", location);
577+
storeSketchLocation(editor, "" + index);
582578
index++;
583579
}
584580
PreferencesData.setInteger("last.sketch.count", index);
585581
}
586582

583+
private void storeSketchLocation(Editor editor, String index) {
584+
String path = editor.getSketch().getMainFilePath();
585+
String loc = StringUtils.join(editor.getPlacement(), ',');
586+
PreferencesData.set("last.sketch" + index + ".path", path);
587+
PreferencesData.set("last.sketch" + index + ".location", loc);
588+
}
589+
587590
protected void storeRecentSketches(Sketch sketch) {
588591
if (sketch.isUntitled()) {
589592
return;

0 commit comments

Comments
 (0)