Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Fix tileCover / TileCoordinate fromScreenCoordinate(#15442) #15461

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

astojilj
Copy link
Contributor

@astojilj astojilj commented Aug 23, 2019

Remove unecessary tile coordinate unproject -> project step.
Unproject+clamp+project isn't always a noop and this was the issue leading to wrong cover calculation in high pitch values.

Unit test added that exposes the issue.

Fixes: #15442

Remove unecessary tile coordinate unproject -> project  step.
Unproject+project isn't always a noop and this was the issue leading to wrong cover calculation in high pitch values.

Fixes: #15442
@astojilj astojilj added this to the release-queso milestone Aug 23, 2019
@astojilj astojilj self-assigned this Aug 23, 2019
@astojilj astojilj added bug Core The cross-platform C++ core, aka mbgl labels Aug 23, 2019

LatLng TransformState::screenCoordinateToLatLng(const ScreenCoordinate& point, LatLng::WrapMode wrapMode) const {
auto coord = screenCoordinateToTileCoordinate(point, 0);
return Projection::unproject(coord.p, 1 / util::tileSize, wrapMode);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 1.0 / util::tileSize

@astojilj astojilj merged commit 9eff849 into master Aug 23, 2019
@astojilj astojilj deleted the astojilj-15442 branch August 23, 2019 15:16
@chloekraw chloekraw added the needs backport Indicates PR needs to be cherrypicked into a previous release branch. label Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Core The cross-platform C++ core, aka mbgl needs backport Indicates PR needs to be cherrypicked into a previous release branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edge tiles do not render on pitched map
3 participants