add auto-resize to IntList.increment()

This commit is contained in:
Ben Fry
2013-08-08 14:48:32 -04:00
parent f26803fe7a
commit 5f7a63aad3
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -393,6 +393,9 @@ public class IntList implements Iterable<Integer> {
* @brief Add one to a value
*/
public void increment(int index) {
if (count <= index) {
resize(index + 1);
}
data[index]++;
}
+5
View File
@@ -25,6 +25,9 @@ X https://github.com/processing/processing/issues/1962
X this should actually be in the code..
X maybe not working on OS X/retina?
X perhaps it's a getGraphics() issue?
X when using increment() on IntList, make sure the index exists
X automatically resize the list if necessary
X (this is more in keeping with increment() in the Dict classes)
cleaning
X load/save methods.. is it save("blah.svg") or saveSVG("blah.svg")
@@ -33,6 +36,8 @@ o decision: useExtension() or something like that
X put saveXxxx() methods inside PApplet
o require people to put things in the data folder
_ blendMode(ADD) is broken with default renderer
_ https://github.com/processing/processing/issues/2012
_ add option to have full screen span across screens
_ display=all in cmd line
_ sketchDisplay() -> 0 for all, or 1, 2, 3...