I've learned (the hard way) that the screen coordinate system set with a WINDOW statement does not apply to anything drawn with a DRAW statement.
Is this a bug or a feature?
Any chance that this could be made explicit in the manual entry for DRAW next time?
DRAW and WINDOW statement
Re: DRAW and WINDOW statement
Already specified in the DRAW documentation page:
Update your documentation manual, or use the FBWiki !
since 2018-08-22.Draw respects the current clipping region as set by the View (Graphics) statement, but its coordinates are not affected by the custom coordinates system.
Update your documentation manual, or use the FBWiki !
Re: DRAW and WINDOW statement
The draw feature respects different windows co-ordinates.
Code: Select all
function Ellipse(x as integer,y as integer,rx as integer,ry as integer,angle as integer,fill as ulong,col as ulong,paintflag as integer=1) as string
dim as string s="Ta" &angle &"Bm" &x &"," &y:s+="Bm+" &rx &"," &0:s+="C" &col
dim as single pi2=8*atn(1)
dim as integer lx,ly
for z as single=0 to pi2*1.1 step pi2/60 '60 steps
if z>pi2 then exit for
dim as integer xpos=rx*cos(z)
dim as integer ypos=ry*sin(z)
if z<>0 then s+="M+" &(xpos-lx) &"," &(ypos-ly)
lx=xpos:ly=ypos
next z
if paintflag then s+="BM" &x &"," &y &"P" & fill &"," & col
return s
end function
screenres 500,500,32
draw ellipse(300,300,100,200,45,rgb(200,0,0),rgb(0,200,0))
print "press a key"
sleep
window screen (0,0)-(1000,1000)
draw ellipse(300,300,100,200,45,rgb(200,0,0),rgb(0,201,0))
print "press a key to end . . ."
sleep
Re: DRAW and WINDOW statement
I searched for any change about DRAW in the changelog.txt and I found this:
That could explain the present behavior than you demonstrate.Version 1.01:
"DRAW now draws U/E/R/F/D/G/L/H using line-drawing routines rather than pixel-by-pixel, resulting in steadier lines and much better speed".
Re: DRAW and WINDOW statement
Therefore, on the other hand it would seem that "M x, y" is not affected by the custom coordinates system.