|
Post by sirbop on Nov 16, 2023 17:13:25 GMT
This is going to sound silly but here goes anyway.
I drew a box from 1,1 ending at 50, 50,
I then drew a horizontal line from 1, 49 to 59, 49.
I though the line would start one pixel inside bottom of the box but it looks like it coincides with the bottom line of the box.
Does that mean that a box from 1,1 ending at 50, 50 gives you a box that is 49 pixels on a side?
See below for the code.
Thanks again for straightening me out.
Ted
open "Draw A Box" for graphics as #box
print #box, "color black"
print #box, "up"
print #box, "goto 1 1"
print #box, "down"
print #box, "box 50 50"
print #box, "up"
print #box, "goto 1 49"
print #box, "down"
print #box, "goto 60 49"
print #box, "up"
print #box, "goto 49 1"
print #box, "down"
print #box, "goto 49 59"
input h$
close #box
|
|
|
Post by cundo on Nov 16, 2023 19:04:39 GMT
Yes I believe so.
open "Draw A Box" for graphics as #box
#box "trapclose [quit]"
print #box, "color blue"
print #box, "down" print #box, "place 1 1" print #box, "box 50 50"
print #box, "color red"
print #box, "up"
print #box, "place 1 49"
print #box, "down"
print #box, "goto 60 49"
print #box, "color green"
print #box, "up"
print #box, "place 49 1"
print #box, "down"
print #box, "goto 49 59"
input h$
[quit] close #box
end
|
|
|
Post by sirbop on Nov 16, 2023 19:15:59 GMT
In the definition of Graphic Commands where is says:
"This command draws a box using the pen position as one corner, and x, y as the other corner."
means
"This command draws a box using the pen position as one corner, and x -1, y - 1 as the other corner.
|
|
|
Post by tsh73 on Nov 16, 2023 19:17:51 GMT
Basically yes Then you draw a line, it draws one pixel short (if you continue drawing from that point with GOTO x y you will get that pixel covered This way, in a chain of line segments, no dot drawn twice - what could make change then drawing with XOR rule (there second-time drawing erases it) ) BTW, that last pixel on the line could be added with
print #box, "posxy dummyX dummyY" print #box, "set ";dummyX;" ";dummyY (it gets coords of last point and then draws single point there)
So box behaves the same, draws one pixel short. Though I have no idea why.
|
|