diff --git a/core/src/processing/data/JSONArray.java b/core/src/processing/data/JSONArray.java index c25ac93f3..0e665c805 100644 --- a/core/src/processing/data/JSONArray.java +++ b/core/src/processing/data/JSONArray.java @@ -1182,9 +1182,10 @@ public class JSONArray { if (length == 1) { JSONObject.writeValue(writer, this.myArrayList.get(0), - thisFactor, indent); + indentFactor, indent); +// thisFactor, indent); } else if (length != 0) { - final int newindent = indent + thisFactor; + final int newIndent = indent + thisFactor; for (int i = 0; i < length; i += 1) { if (commanate) { @@ -1193,9 +1194,11 @@ public class JSONArray { if (indentFactor != -1) { writer.write('\n'); } - JSONObject.indent(writer, newindent); + JSONObject.indent(writer, newIndent); +// JSONObject.writeValue(writer, this.myArrayList.get(i), +// thisFactor, newIndent); JSONObject.writeValue(writer, this.myArrayList.get(i), - thisFactor, newindent); + indentFactor, newIndent); commanate = true; } if (indentFactor != -1) { diff --git a/core/src/processing/data/JSONObject.java b/core/src/processing/data/JSONObject.java index 0b1c1127c..165b099cd 100644 --- a/core/src/processing/data/JSONObject.java +++ b/core/src/processing/data/JSONObject.java @@ -1790,9 +1790,10 @@ public class JSONObject { if (actualFactor > 0) { writer.write(' '); } - writeValue(writer, this.map.get(key), actualFactor, indent); + //writeValue(writer, this.map.get(key), actualFactor, indent); + writeValue(writer, this.map.get(key), indentFactor, indent); } else if (length != 0) { - final int newindent = indent + actualFactor; + final int newIndent = indent + actualFactor; while (keys.hasNext()) { Object key = keys.next(); if (commanate) { @@ -1801,14 +1802,14 @@ public class JSONObject { if (indentFactor != -1) { writer.write('\n'); } - indent(writer, newindent); + indent(writer, newIndent); writer.write(quote(key.toString())); writer.write(':'); if (actualFactor > 0) { writer.write(' '); } - writeValue(writer, this.map.get(key), actualFactor, - newindent); + //writeValue(writer, this.map.get(key), actualFactor, newIndent); + writeValue(writer, this.map.get(key), indentFactor, newIndent); commanate = true; } if (indentFactor != -1) { diff --git a/core/todo.txt b/core/todo.txt index 5b4901c66..329e82178 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -15,14 +15,12 @@ X https://github.com/processing/processing/pull/2070 X Java2D images crash after being resized X https://github.com/processing/processing/issues/2113 X constrain lerpColor() between 0 and 1 +X JSONObject/Array.format(-1) not working on embedded JSONObjects +X https://github.com/processing/processing/issues/2119 X allow println() and print() to take varargs o https://github.com/processing/processing/issues/2056 _ causes conflict with printing arrays -_ JSONObject/Array.format(-1) not working on embedded JSONObjects -_ should be a quick fix, notes are in the report -_ https://github.com/processing/processing/issues/2119 - opengl X fix inconsistency with P2D and resetMatrix() X https://github.com/processing/processing/issues/2087