Bug 586 : double output from draw()
Last modified: 2008-08-16 15:02




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
petros
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2007-06-25 03:28
Version: 0124 (no Java)
OS: Vista Ult.
AMD 3400+, 1GB RAM

From discourse thread:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1180546722

Issue: If size() is not called within setup(), code within draw() is
executed twice, even if noLoop() is used.

* This issue does not appear when using processing with Java included.

The following example produces double output:

Example 3:
---------
void setup() {
noLoop();
}

void draw() {
print("hello"); //TEXT AREA OUTPUT: hellohello
}

Workaround:
This problem can be overcome by calling size() within setup().

Example 3:
---------
void setup() {
size(320,240); // <-- FIXES THE DOUBLE OUTPUT PROBLEM
noLoop();
}

void draw() {
print("hello"); //TEXT AREA OUTPUT: hello
}
Additional Comment #1 From fry 2008-08-16 15:02
appears to have just been a jvm bug, not seeing this behavior anymore with
more recent releases.