We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › export bug  applet display is too small
Page Index Toggle Pages: 1
export bug?  applet display is too small (Read 659 times)
export bug?  applet display is too small
Sep 1st, 2006, 4:34pm
 
I have encountered a strange bug when I export my applet.
All goes well when I specify the size of the display, e.g., size(400,300)
However, the exported display is tiny when I use constants, e.g., size(W,H)
and doesn't match the display size when I run the applet in Processing.
I am using Processing 0115 on Mac OS X 10.4.7

Here is an example that you can try yourself to check if this is a bug:

// export bug
final int W = 400;
final int H = 300;

void setup() {
 // size(400,300); // this works
 size(W,H);        // this doesn't work
 noLoop();
}

void draw() {
 background(255);
 fill( 128 );
 stroke( 0 );
 ellipse(width/2,height/2, 40,30 );
}
Re: export bug?  applet display is too small
Reply #1 - Sep 1st, 2006, 5:02pm
 
common bug.. just edit the html, and set the proper size there.. it's default to 100x100

-seltar
Re: export bug?  applet display is too small
Reply #2 - Sep 1st, 2006, 7:02pm
 
yes, but if we were supposed to go in and edit the HTML and JAVA then why bother to use Processing?  The "one-click-to-export" is a great feature, ... and it should work.  Hopefully this bug will get fixed in the next revision.

-- djones
Re: export bug?  applet display is too small
Reply #3 - Sep 1st, 2006, 11:41pm
 
It's not a bug. It's just how it works. Processing can't work out how big the applet should be if you use variables. You could be doing anything with them, e.g. setting the width to be some function of the time of day, so how could you possibly export a HTML page with the right width/height?

There's no real reason to use variables for the width and height, since the values are accessible after you call size() as 'width' and 'height', so both ways, you only need to se tthe width/height in one place.
Re: export bug?  applet display is too small
Reply #4 - Sep 4th, 2006, 4:17pm
 
johng is correct, this is not a bug. this is why the reference for size() says "Using variables as the parameters to size() is strongly discouraged and can create problems. Use the width and height variables if you need to know the dimensions of the display window within your program."
http://processing.org/reference/size_.html
Page Index Toggle Pages: 1