Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CJK vertical/horizontal detection angle changes based on aspect ratio #5546

Closed
ChrisLoer opened this issue Oct 27, 2017 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@ChrisLoer
Copy link
Contributor

Porting is great for finding bugs!

The logic here tries to determine if the label has crossed a 45 degree angle by seeing if the rise is greater than the run:

https://github.com/mapbox/mapbox-gl-js/blob/master/src/symbol/projection.js#L266

The problem is that x and y are in GL coordinates, not pixel coordinates, so they're not directly comparable unless the viewport is exactly square. At a 2:1 aspect ratio, the angle at which the glyphs flip will be cut down to 22.5 degrees, which doesn't look totally broken but does look a little odd.

Unfortunately for us, our render tests for Chinese are all done on perfectly square canvases, so we didn't notice. Needs a regression test.

/cc @ansis @1ec5

@ChrisLoer ChrisLoer self-assigned this Oct 27, 2017
@ChrisLoer ChrisLoer added this to the v0.41.1 milestone Oct 30, 2017
ChrisLoer added a commit that referenced this issue Oct 30, 2017
…ouldn't be affected by viewport aspect ratio.
@ChrisLoer ChrisLoer modified the milestones: v0.41.1, v0.42 Oct 31, 2017
ChrisLoer added a commit that referenced this issue Nov 1, 2017
…ouldn't be affected by viewport aspect ratio.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant