From b70c72fcfe7be28baff722719031c76f4e55153a Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 2 Jun 2025 13:43:39 +0100 Subject: [PATCH] fix two more off-by-one errors - we were incrementing num-tiles, no need to - the overpass fetcher was fetcing one tile too far left --- pkgs/maps/main.fnl | 4 ++-- pkgs/maps/tiles.fnl | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/maps/main.fnl b/pkgs/maps/main.fnl index 5b5e367..3895f7b 100644 --- a/pkgs/maps/main.fnl +++ b/pkgs/maps/main.fnl @@ -135,8 +135,8 @@ label.readout { (let [map-surface (window:create_similar_surface cairo.Content.COLOR - (* tile-size (+ 1 num-tiles-x)) - (* tile-size (+ 1 num-tiles-y))) + (* tile-size num-tiles-x) + (* tile-size num-tiles-y)) g (cairo.Context.create map-surface)] (g:set_source_rgb 1 1 1) diff --git a/pkgs/maps/tiles.fnl b/pkgs/maps/tiles.fnl index 9880df4..45bc3e2 100644 --- a/pkgs/maps/tiles.fnl +++ b/pkgs/maps/tiles.fnl @@ -47,9 +47,10 @@ (fn overpass [lat lon zoom] (let [width (/ 360 (^ 2 zoom)) n (+ lat width) ;XXX adjust for latitude - w (- lon width) + w lon ; (- lon width) s lat - e lon] + e (+ lon width) + ] (-> [ "[out:json];"