print fewer upside down road labels
This commit is contained in:
parent
e728052bb6
commit
c53120ab2a
@ -122,10 +122,16 @@ label.readout {
|
||||
(let [[x y] (. points biggest-n)
|
||||
[nx ny] (. points (+ 1 biggest-n))
|
||||
angle (math.atan (- ny y) (- nx x))]
|
||||
(values
|
||||
(* tile-size (- x bounds.min.x))
|
||||
(* tile-size (- y bounds.min.y))
|
||||
angle)))
|
||||
(if (> nx x)
|
||||
(values
|
||||
(* tile-size (- x bounds.min.x))
|
||||
(* tile-size (- y bounds.min.y))
|
||||
angle)
|
||||
(values ; if way runs r->l, prefer label to read l->r
|
||||
(* tile-size (- nx bounds.min.x))
|
||||
(* tile-size (- ny bounds.min.y))
|
||||
(+ math.pi angle)))))
|
||||
|
||||
|
||||
|
||||
(fn cairo-the-map [window]
|
||||
|
Loading…
Reference in New Issue
Block a user