I wish to draw a (hair-)line, from one point to another.
The drawing-api at http://www.kirupa.com/developer/actionscript/tricks/drawing_api.htm gives a nice explanation, but flash is slightly off.
The lineTo statement draws a line towards the specified point, not to. It’s probably a matter of opinion, but I’m fairly confident that we all agree that drawing a line from (1,1) **to **(5,1) should result in a line 5 pixel long. That’s how we’ve all learned it when we were young, that how other programming languages do it, etc. [SIZE=1](One could state that ‘going to school’ doesn’t mean you actually enter the building :tired:, but that’s just avoiding the issue)[/SIZE]
But not Flash. Drawing this line results in a line of only 4 pixels long, the line stops at coordinates (4,1).
I can see the benefits in this when drawing (transparent) connected lines and closed shapes, but it has it’s drawback when creating single lines.
I’m probably not the first one to run into this problem. Maybe it’s just a setting somewhere?
How do I get flash to draw a line to the exact point I specify? Preferably without having to analyze the direction of the line and moving the destination coordinates one pixel further.