Strange DrawRect behaviour

Mweigand
Posts: 7
Joined: 2008-04-22
Location: Germany

For some reason for me "DrawRect" behaves odd when used in a function:
It seems only the first call of drawrect will be done and all others ignored.

For example

setdrawlayer /W=main Userfront
SetDrawEnv /W=main xcoord=bottom, ycoord=left
for (i=0;i<11;i+=1)
   drawrect /W=main (100*i-10),0,(100*i+10),10
endfor

will only result in a single rectangle drawn.
This happens in userfront as well as in userback.
Any idea why this is happening and how to circumvent it?

I noticed some similar oddities with drawtext, too....


Mweigand
Posts: 7
Joined: 2008-04-22
Location: Germany

Well, some additional info:
I thought that maybe i overlooked something and saved the graph macro for the created graph.
In there, all drawrect commands were also present. But for some reason not drawn (even after recreating the graph from the macro)


Igor
Posts: 7
Joined: 2007-06-29
Location: United States

All you need is to add to your SetDrawEnv command a "save" keyword as in:

SetDrawEnv /W=main xcoord=bottom, ycoord=left, save

Otherwise you could put this call inside your loop but that would be wasteful.

HTH,

AG


Back to top