Repository navigation
Stop the map's tiles showing a grid of dark lines - #111
Merged
Merged
Conversation
At a fractional device pixel ratio (Windows at 125 %, say) Chrome painted each tile placed by left/top about a fifth of a pixel past its edge, so every tile's first column and row let the page through. Place tiles with a translate instead, and keep a drag's position on whole device pixels as the resting position already is. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
Moving (and, more faintly, resting on) the map showed a grid of thin dark lines along the tile edges, on screens with a fractional device pixel ratio (Windows at 125 %/150 %, many laptops). At 100 % there were none.
Why
The tile images are clean. Chrome painted each
<img>placed byleft/topabout 0.2 device px past its layout edge, so every tile's first column and row was ~20 % see-through and the page behind showed. Mid-drag the viewport translate was also fractional, so every tile edge straddled a pixel.Fix
TileLayer: tiles are placed withtransform: translate(), which Chrome keeps exact.useMapViewport: a live pan (no scale on top of the resting zoom) sits on whole device pixels, as the resting position already did.Overlapping tiles was rejected: prosperity tiles are ~40 % partial alpha, so overlap strips would darken.
Checked
Chromium against live map data (solid-black tiles on a white background, worst see-through at a tile edge):
tscclean; 1,427 map/viewport/admin/chronicle tests pass. Mid-pinch (scale ≠ 1) seams can still flash until the zoom settles.🤖 Generated with Claude Code