Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,23 @@
function line(img, x0::Int, y0::Int, x1::Int, y1::Int, col)
dx = int(abs(x1-x0))
dy = int(abs(y1-y0))
sx = x0<x1 ? 1 : -1
sy = y0<y1 ? 1 : -1;
err = (dx>dy ? dx : -dy)/2
while true
@inbounds img[x0,y0]=col
if (x0==x1 && y0==y1); break; end
e2 = err;
if e2 > -dx
err -= dy
x0 += sx
end
if e2 < dy
err += dx
y0 += sy
end
end
end