FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 341 : size of sketch different in setup() and draw()
Last modified: 2007-06-24 12:19
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P2
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
hungerburg
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2006-05-08 03:54
hello,
here the "size" of a sketch in the draw() routine is different from the
one set in the setup handler, when running a sketch from the ide menu. but
width and height are the same in setup and draw, when calling the "present
sketch" menu item.
[code]
/* set then get display window size */
void setup()
{
background(255);
size (200, 200); // or P3D, OPENGL
println ("S: W="+width + " H=" + height);
noLoop();
}
void draw() {
println ("D: W="+width + " H=" + height);
}
void mouseDragged()
{
println ("M: W="+width + " H=" + height + " : X=" + mouseX + " Y=" + mouseY);
}
[/code]
results read:
S: W=200 H=200
D: W=200 H=200
D: W=210 H=207
M: W=210 H=207 : X=199 Y=198
M: W=210 H=207 : X=201 Y=200
M: W=210 H=207 : X=229 Y=225
M: W=210 H=207 : X=264 Y=256
notice, there are two lines from the draw routine. (this also shows, one
can drag the mouse outside of the window, and still get coordinates, even
negative ones, not a bug.)
Additional Comment
#1 From fry 2006-10-12 20:22
finally managed to get this to replicate. will be looking for a fix.
Additional Comment
#2 From fry 2007-06-01 15:59
***
Bug 563
has been marked as a duplicate of this bug. ***
Additional Comment
#3 From fry 2007-06-24 12:17
now fixed for 0125.