diff --git a/android/todo.txt b/android/todo.txt index d5bc36c8a..96155a5d3 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -1,10 +1,11 @@ 0190 android -_ allow screenWidth/Height as parameters to size() -_ right now would cause NumberFormatException +X allow screenWidth/Height as parameters to size() +X right now would cause NumberFormatException X add notes to the wiki about the size() method -_ make sure sketchRenderer()/sketchWidth()/sketchHeight() are working on desktop -_ see about getting them documented in the reference +X make sure sketchRenderer()/sketchWidth()/sketchHeight() are working on desktop +o see about getting them documented in the reference +_ do a writeup of the size() method in the wiki _ size() command is currently ignored in Android _ http://dev.processing.org/bugs/show_bug.cgi?id=1397 _ Implement P3D, OpenGL, A3D for Android diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index ceaf701e8..e204c7c60 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -664,8 +664,7 @@ public class PApplet extends Applet public void init() { -// println("Calling init()"); - + // using a local version here since the class variable is deprecated Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); screenWidth = screen.width; screenHeight = screen.height; @@ -710,16 +709,16 @@ public class PApplet extends Applet // Component objects, its size() may already be set externally (perhaps // by a LayoutManager). In this case, honor that size as the default. // Size of the component is set, just create a renderer. - g = makeGraphics(size.width, size.height, getSketchRenderer(), null, true); + g = makeGraphics(size.width, size.height, sketchRenderer(), null, true); // This doesn't call setSize() or setPreferredSize() because the fact // that a size was already set means that someone is already doing it. } else { // Set the default size, until the user specifies otherwise this.defaultSize = true; - int w = getSketchWidth(); - int h = getSketchHeight(); - g = makeGraphics(w, h, getSketchRenderer(), null, true); + int w = sketchWidth(); + int h = sketchHeight(); + g = makeGraphics(w, h, sketchRenderer(), null, true); // Fire component resize event setSize(w, h); setPreferredSize(new Dimension(w, h)); @@ -735,17 +734,17 @@ public class PApplet extends Applet } - public int getSketchWidth() { + public int sketchWidth() { return DEFAULT_WIDTH; } - public int getSketchHeight() { + public int sketchHeight() { return DEFAULT_HEIGHT; } - public String getSketchRenderer() { + public String sketchRenderer() { return JAVA2D; }