fix: correct coordinate calculation in _retainChildren recursion#2174
Merged
JaffaKetchup merged 3 commits intofleaflet:masterfrom Dec 21, 2025
Merged
Conversation
Member
|
Hey @shindonghwi, great spot, and thanks for the test addition! Could you explain whether this has fixed a bug you've found (new or existing)? We usually like to merge fix PRs with a bug report attached. |
Contributor
Author
|
Found it while reading the code. Opened an issue here: #2175 |
_retainChildren recursion
JaffaKetchup
approved these changes
Dec 21, 2025
Member
JaffaKetchup
left a comment
There was a problem hiding this comment.
LGTM, thanks for spotting this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed a bug in
_retainChildrenwhere the recursive call was passingi, jinstead of the calculated child coordinates2 * x + i, 2 * y + j.This caused incorrect tile lookups at z+2 level. For a tile at (100, 200, z=10), it was searching (0-3, 0-3) instead of (400-403, 800-803) at z=12.
The sibling function
_retainAncestorcorrectly passes the calculated coordinates, so this appears to be a copy-paste oversight.