More cleanup, fix things broken in last cleanup

This commit is contained in:
2024-11-19 11:53:59 -06:00
parent f4b52415dc
commit 3eb52aa430
2 changed files with 8 additions and 13 deletions

View File

@@ -33,12 +33,11 @@
(lambda (node)
(cairo-set-source cr black)
(let-values ([(x y) (car+cdr (node-coords node))]
[edges (node-edges node)])
[(edges) (node-edges node)])
(for-each
(lambda (edge)
(let* ([other (assq-ref graph edge)]
[ox (car (node-coords other))]
[oy (cdr (node-coords other))])
(let*-values ([(other) (assq-ref graph edge)]
[(ox oy) (car+cdr (node-coords other))])
(cairo-move-to cr x y)
(cairo-line-to cr ox oy)
(cairo-stroke cr)))
@@ -48,7 +47,7 @@
"Creates a closure that draws the nodes of graph using cr"
(lambda (node)
(let-values ([(x y) (car+cdr (node-coords node))]
[color (or (node-color node) white)])
[(color) (or (node-color node) white)])
(cairo-arc cr x y 4. 0. tau)
(cairo-set-source cr color)
(cairo-fill-preserve cr)