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)
|
(let [[x y] (. points biggest-n)
|
||||||
[nx ny] (. points (+ 1 biggest-n))
|
[nx ny] (. points (+ 1 biggest-n))
|
||||||
angle (math.atan (- ny y) (- nx x))]
|
angle (math.atan (- ny y) (- nx x))]
|
||||||
|
(if (> nx x)
|
||||||
(values
|
(values
|
||||||
(* tile-size (- x bounds.min.x))
|
(* tile-size (- x bounds.min.x))
|
||||||
(* tile-size (- y bounds.min.y))
|
(* tile-size (- y bounds.min.y))
|
||||||
angle)))
|
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]
|
(fn cairo-the-map [window]
|
||||||
|
Loading…
Reference in New Issue
Block a user