Bug 802 : rect() not displaying properly (Vista 64)
Last modified: 2008-06-03 12:56




Status:
RESOLVED
Resolution:
DUPLICATE of bug 726
Priority:
P2
Severity:
normal

 

Reporter:
doc
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-06-03 10:10
Rect() does not display properly in Vista 64.

Code sample:
void display() {
if ( mydelay > 0 ) mydelay--;
stroke(fore);
fill(back);
rect( x,y,xw,yt );
rect( x,y,xw,yh1p );
rect( xw2m,yh2m,xw2p,yh2p ); textFont(font); // fry fix
fill(fore); text( title,x2p,y2m ); fill(back);
if ( displayed <= items ) {
rect( scx, scy, scw, sch );
}
.
.
}

Where this function is called in setup(), supposedly prior to display()
routine (above) called in draw():

void move( int xx, int yy ) {
this.retitle( title );
h=displayed*item_height;
if ( displayed+scrolled >= items ) spd=items; // stops empty lists
from crashing the gui
else spd=scrolled+displayed;
xx-=w;
yy-=h;
x=xx;
y=yy; yt=y-(fontHeight);
xw=xx+w;
x2p=xx+2; y2p=yy+2;
x4p=xx+4; y2m=yy-2;
// xw4m=xw-4;
xw2m=xw-2;
xw2p=xw+2;
yh=yy+h;
yh1p=yy+h+1;
yh2p=yh1p+2;
yh2m=yh2p-4;
yp1=yy+1;

scux=xw+2; scux5=scux+5; scux3=scux+3;
scuy=yy+5; scuy5=scuy+5;
scdx=xw+2; scdx5=scdx+5; scdx3=scdx+3;
scdy=yy+(fontHeight); scdy5=scdy+5;
scx=xw; scy=yy;
scw=scx+10; sch=scdy+22;

}


And this function is called in setup():
(perhaps this is not being called??)

void GUI() {
font = loadFont("Kartika-48.vlw");
textFont(font,fontSize);
noStroke();
smooth();
rectMode(CORNERS);
imageMode(CORNERS);
fontHeight=fontSize-4;
}
Additional Comment #1 From doc 2008-06-03 10:13
Moving GUI() call to draw() fixed the problem with the rect(), except that
textWidth() is not reliable.
Additional Comment #2 From fry 2008-06-03 10:22
the issue with bug #726 is that the default settings are reset when you
leave setup() and enter draw(). normally you should be able to set
font/fill/stroke/etc. inside setup() and have them work inside draw()
(that's the whole point of setup).

so is the problem in your sketch that rect() doesn't have its fill/stroke
set properly because it's been reset after setup? if so, this will be a
dupe, and the workaround, like the font issue, is to set stroke/fill inside
draw() (or a method called from draw).
Additional Comment #3 From doc 2008-06-03 12:54
> so is the problem in your sketch that rect() doesn't have its fill/stroke
> set properly because it's been reset after setup? if so, this will be a
> dupe, and the workaround, like the font issue, is to set stroke/fill inside
> draw() (or a method called from draw).

Will this be fixed in an upcoming version? It seems rather fundamental to
your programming environment. Strange that this does not occur on all systems.
Additional Comment #4 From fry 2008-06-03 12:56
yes, it is a very high priority and should be fixed in the next few weeks,
if not sooner.

*** This bug has been marked as a duplicate of 726 ***