draw roads fatter and with edging
This commit is contained in:
parent
8ee10214c8
commit
05401941b4
@ -94,6 +94,7 @@ label.readout {
|
|||||||
(fn cairo-the-map [window]
|
(fn cairo-the-map [window]
|
||||||
(let [{ : lat : lon : zoom } app-state
|
(let [{ : lat : lon : zoom } app-state
|
||||||
{ : num-tiles-x : num-tiles-y &as bounds } (map-bounds lat lon zoom)
|
{ : num-tiles-x : num-tiles-y &as bounds } (map-bounds lat lon zoom)
|
||||||
|
road-width 14
|
||||||
lines []]
|
lines []]
|
||||||
|
|
||||||
(for [x bounds.min.x bounds.max.x]
|
(for [x bounds.min.x bounds.max.x]
|
||||||
@ -111,19 +112,38 @@ label.readout {
|
|||||||
(g:rectangle 0 0 (* tile-size num-tiles-x) (* tile-size num-tiles-y))
|
(g:rectangle 0 0 (* tile-size num-tiles-x) (* tile-size num-tiles-y))
|
||||||
(g:fill)
|
(g:fill)
|
||||||
|
|
||||||
(g:set_source_rgb 0.2 0.2 0.6)
|
|
||||||
(g:set_line_width 2)
|
|
||||||
(each [_ line (pairs lines)]
|
(each [_ line (pairs lines)]
|
||||||
(case line
|
(case line
|
||||||
[[sx sy] & more]
|
[[sx sy] & more]
|
||||||
(do
|
(do
|
||||||
|
(g:save)
|
||||||
|
(g:set_source_rgb 0 0 0)
|
||||||
|
(g:set_line_width road-width)
|
||||||
(g:move_to (* tile-size (- sx bounds.min.x))
|
(g:move_to (* tile-size (- sx bounds.min.x))
|
||||||
(* tile-size (- sy bounds.min.y)))
|
(* tile-size (- sy bounds.min.y)))
|
||||||
(each [_ [x y] (ipairs more)]
|
(each [_ [x y] (ipairs more)]
|
||||||
(let [x1 (* tile-size (- x bounds.min.x))
|
(let [x1 (* tile-size (- x bounds.min.x))
|
||||||
y1 (* tile-size (- y bounds.min.y))]
|
y1 (* tile-size (- y bounds.min.y))]
|
||||||
(g:line_to x1 y1))))))
|
(g:line_to x1 y1)))
|
||||||
(g:stroke)
|
(g:stroke)
|
||||||
|
(g:restore))))
|
||||||
|
|
||||||
|
(each [_ line (pairs lines)]
|
||||||
|
(case line
|
||||||
|
[[sx sy] & more]
|
||||||
|
(do
|
||||||
|
(g:save)
|
||||||
|
(g:set_source_rgb 1 1 1)
|
||||||
|
(g:set_line_width (- road-width 2))
|
||||||
|
(g:move_to (* tile-size (- sx bounds.min.x))
|
||||||
|
(* tile-size (- sy bounds.min.y)))
|
||||||
|
(each [_ [x y] (ipairs more)]
|
||||||
|
(let [x1 (* tile-size (- x bounds.min.x))
|
||||||
|
y1 (* tile-size (- y bounds.min.y))]
|
||||||
|
(g:line_to x1 y1)))
|
||||||
|
(g:stroke)
|
||||||
|
(g:restore))))
|
||||||
|
|
||||||
map-surface)))
|
map-surface)))
|
||||||
|
|
||||||
(var map-surface nil)
|
(var map-surface nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user