Skip to content

Commit 110782d

Browse files
committed
fix bug in initial angle computation
1 parent 1eb2613 commit 110782d

File tree

1 file changed

+11
-2
lines changed
  • drracket-core-lib/drracket/private/syncheck

1 file changed

+11
-2
lines changed

drracket-core-lib/drracket/private/syncheck/gui.rkt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,8 +2184,17 @@ If the namespace does not, they are colored the unbound color.
21842184
var-arrow-end-x-min
21852185
var-arrow-end-x-max)
21862186
(define base-%age
2187-
(/ (- end-x var-arrow-end-x-min)
2188-
(- var-arrow-end-x-max var-arrow-end-x-min)))
2187+
(cond
2188+
;; it can be that we have only a single arrow
2189+
;; and they might be directly above each other,
2190+
;; which will end up with var-arrow-end-x-max and
2191+
;; var-arrow-end-x-min equal to each other; in
2192+
;; that case we want a straight up/down arrow
2193+
;; (instead of the nan from the arithmetic below)
2194+
[(= var-arrow-end-x-max var-arrow-end-x-min) 0]
2195+
[else
2196+
(/ (- end-x var-arrow-end-x-min)
2197+
(- var-arrow-end-x-max var-arrow-end-x-min))]))
21892198
(if (< (var-arrow-start-pos-left arrow)
21902199
(var-arrow-end-pos-left arrow))
21912200
base-%age

0 commit comments

Comments
 (0)