Bitmap/Bresenham's line algorithm: Difference between revisions
Content deleted Content added
imported>Chinhouse |
imported>Chinhouse |
||
Line 2,836:
This GUI implementation is for use with [http://miniscript.org/MiniMicro Mini Micro].
<syntaxhighlight lang="miniscript">
▲Img.line = function(x0, y0, x1, y1, colr)
sign = function(a, b)
if a < b then return 1
Line 2,866 ⟶ 2,856:
while true
if x0 == x1 and y0 == y1 then break
e2 = err
Line 2,878 ⟶ 2,868:
end if
end while
end function
img=
drawLine img
gfx.clear
gfx.drawImage img, 0, 0
|