biscuit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 4edf246cf66aabfc5e8ca8e42d9fa034a9307404
parent d7852700a5439a9521591dad7b3be6875c435668
Author: Daniel Barlow <dan@telent.net>
Date:   Mon,  9 Jun 2025 13:05:43 +0100

extract bounds= function

Diffstat:
Mpkgs/maps/main.fnl | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pkgs/maps/main.fnl b/pkgs/maps/main.fnl @@ -129,7 +129,11 @@ label.readout { (let [(tile-x tile-y) (tiles.latlon->tile app-state.lat app-state.lon app-state.zoom)] (map-bounds-tile tile-x tile-y))) - +(fn bounds= [a b] + (and (= a.min.x b.min.x) + (= a.min.y b.min.y) + (= a.max.x b.max.x) + (= a.max.y b.max.y))) (local cq (cqueues.new)) @@ -309,9 +313,7 @@ label.readout { (merge app-state new-vals) (let [bounds (map-bounds app-state.lat app-state.lon app-state.zoom)] - (when (or - (not (= old-bounds.min.x bounds.min.x)) - (not (= old-bounds.min.y bounds.min.y))) + (when (not (bounds= old-bounds bounds)) (set map-surface nil))) (set app-state.orientation (+ app-state.orientation