From 1ee968d3a2f1582faad42a8a3498a27ab69ec1eb Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 7 Jun 2025 11:50:17 +0100 Subject: [PATCH] pass bounds to draw-onto-map-surface instead of recalculating --- pkgs/maps/main.fnl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/maps/main.fnl b/pkgs/maps/main.fnl index a8edd98..656909c 100644 --- a/pkgs/maps/main.fnl +++ b/pkgs/maps/main.fnl @@ -180,8 +180,8 @@ label.readout { (var map-surface nil) -(fn draw-onto-map-surface [surface lat lon zoom] - (let [{ : num-tiles-x : num-tiles-y &as bounds } (map-bounds lat lon zoom) +(fn draw-onto-map-surface [surface bounds zoom] + (let [{ : num-tiles-x : num-tiles-y } bounds road-width 14 lines []] @@ -244,7 +244,7 @@ label.readout { cairo.Content.COLOR (* tile-size bounds.num-tiles-x) (* tile-size bounds.num-tiles-y)) - (draw-onto-map-surface lat lon zoom))))) + (draw-onto-map-surface bounds zoom))))) (g:set_source_surface map-surface (- offset-x) (- offset-y)) (g:set_operator cairo.Operator.SOURCE)