Skip to content

Commit

Permalink
Merge pull request podusowski#211 from podusowski/209-zooming-out-too…
Browse files Browse the repository at this point in the history
…-far-causes-a-panic-in-debug-builds

don't calculate a placeholder when zoom is maxed out
  • Loading branch information
podusowski authored Oct 29, 2024
2 parents f4343bb + aa36ac1 commit 4aa59d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion walkers/src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl HttpTiles {
fn placeholder_with_different_zoom(&self, tile_id: TileId) -> Option<TextureWithUv> {
// 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);

Expand Down

0 comments on commit 4aa59d9

Please sign in to comment.