From 0ca274b94df73ae10a6531cafd279fe3ca47577e Mon Sep 17 00:00:00 2001 From: Piotr Podusowski Date: Tue, 29 Oct 2024 21:53:37 +0100 Subject: [PATCH 1/2] don't calculate a placeholder when zoom is maxed out --- walkers/src/tiles.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/walkers/src/tiles.rs b/walkers/src/tiles.rs index 9e1101c2..e69d21c9 100644 --- a/walkers/src/tiles.rs +++ b/walkers/src/tiles.rs @@ -158,7 +158,7 @@ impl HttpTiles { fn placeholder_with_different_zoom(&self, tile_id: TileId) -> Option { // Currently, only a single zoom level down is supported. - let zoom = tile_id.zoom - 1; + let zoom = tile_id.zoom.checked_sub(1)?; let x = (tile_id.x / 2, tile_id.x % 2); let y = (tile_id.y / 2, tile_id.y % 2); From aa36ac1eae6896176032051cd702373c5117b423 Mon Sep 17 00:00:00 2001 From: Piotr Podusowski Date: Tue, 29 Oct 2024 22:06:03 +0100 Subject: [PATCH 2/2] changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ade70b..0f8f8c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## Unreleased + + * Fixed crash when zoom is maxed far out. + ## 0.26.0 * `HttpTiles` will now attempt to use already downloaded tiles with a lower zoom level as