Anonymous user
Bitmap/Bresenham's line algorithm: Difference between revisions
Bitmap/Bresenham's line algorithm (view source)
Revision as of 03:11, 7 November 2023
, 6 months ago→{{header|MiniScript}}
imported>Chinhouse No edit summary |
imported>Chinhouse |
||
Line 2,788:
This GUI implementation is for use with [http://miniscript.org/MiniMicro Mini Micro].
<syntaxhighlight lang="miniscript">
▲gfx.bline = function(x1, y1, x2, y2)
dx = abs(x2 - x1)
sx = -1 * -(x1 < x2)
Line 2,798 ⟶ 2,797:
er = floor(er / 2)
while true
self.setPixel x1, y1, colr
if x1 == x2 and y1 == y2 then break
e2 = er
|