diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-20 19:47:57 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-20 19:47:57 -0700 |
commit | fb34909b4eb744811f6da2354667179c108870cb (patch) | |
tree | 8b5f4c662b9868965645968ef188c5e7ec3b3d10 /309stream.subx | |
parent | fb3967876c8b97ebf8a7ad5570623a8a4c6dead6 (diff) | |
download | mu-fb34909b4eb744811f6da2354667179c108870cb.tar.gz |
get bresenham line drawing working with a trace
(brline . (fn () (screen x0 y0 x1 y1 color) ((fn (dx dy sx sy) ((fn (err) (brline1 screen x0 y0 x1 y1 dx dy sx sy err color)) (+ dx dy))) (abs (- x1 x0)) (- 0 (abs (- y1 y0))) (sgn (- x1 x0)) (sgn (- y1 y0))))) (brline1 . (fn () (screen x y xmax ymax dx dy sx sy err color) (pixel screen x y color) (if (andf (= x xmax) (= y ymax)) () ((fn (e2) (brline1 screen (if (>= e2 dy) (+ x sx) x) (if (<= e2 dx) (+ y sy) y) xmax ymax dx dy sx sy (+ err (+ (if (>= e2 dy) dy 0) (if (<= e2 dx) dx 0))) color)) (* err 2))))) sandbox: (brline screen 1 1 5 5 12) There are two ideas stemming from this commit: - I need an extremely compact on-screen trace to underlie the trace UX - perhaps we should start truncating trace lines
Diffstat (limited to '309stream.subx')
0 files changed, 0 insertions, 0 deletions