Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -10,30 +10,30 @@ fn plot img coord steep col =
|
|||
fn drawLine img start end col =
|
||||
(
|
||||
local steep = (abs (end.y - start.y)) > (abs (end.x - start.x))
|
||||
|
||||
|
||||
if steep then
|
||||
(
|
||||
swap start.x start.y
|
||||
swap end.x end.y
|
||||
)
|
||||
|
||||
|
||||
if start.x > end.x then
|
||||
(
|
||||
swap start.x end.x
|
||||
swap start.y end.y
|
||||
)
|
||||
|
||||
|
||||
local deltaX = end.x - start.x
|
||||
local deltaY = abs (end.y - start.y)
|
||||
local error = deltaX / 2.0
|
||||
local yStep = -1
|
||||
local y = start.y
|
||||
|
||||
|
||||
if start.y < end.y then
|
||||
(
|
||||
yStep = 1
|
||||
)
|
||||
|
||||
|
||||
for x in start.x to end.x do
|
||||
(
|
||||
plot img [x, y] steep col
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue