FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Bug Fixes, Implemented Suggestions
(Moderator: fry)
   Exported applet has wrong size when static
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Exported applet has wrong size when static  (Read 634 times)
amoeba

WWW
Exported applet has wrong size when static
« on: Oct 26th, 2003, 8:00pm »

[processing 0065]
 
When exporting an applet, Processing will write incorrect width and height to the APPLET tag if the sketch doesn't use "setup" and there is no blank line before size(). It seems it doesn't recognize the size command if it's on the very first line of a program. Instead it writes the default WIDTH=100 and HEIGHT=100.
 
For instance, this code will export incorrectly:
 
Code:
size (300,300);
background(30,255,68);
ellipse(30,30, 70,80);

 
And this will be correct:
 
Code:
// single blank line
size (300,300);
background(30,255,68);
ellipse(30,30, 70,80);

« Last Edit: Oct 26th, 2003, 8:00pm by amoeba »  

marius watz // amoeba
http://processing.unlekker.net/
fry


WWW
Re: Exported applet has wrong size when static
« Reply #1 on: Oct 27th, 2003, 2:15am »

easily fixed. problem was that the command checking for size() makes sure that there isn't additional text (only whitespace) in front of the size() command (i.e. so it doesn't get confused by something like "resize()") but at the beginning of a program, there was no whitespace.
 
repaired for 67.
 
Pages: 1 

« Previous topic | Next topic »