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

test-suite text-rotation-alignment tests are failing #6410

Closed
jfirebaugh opened this issue Sep 21, 2016 · 6 comments
Closed

test-suite text-rotation-alignment tests are failing #6410

jfirebaugh opened this issue Sep 21, 2016 · 6 comments
Labels
Core The cross-platform C++ core, aka mbgl tests

Comments

@jfirebaugh
Copy link
Contributor

jfirebaugh commented Sep 21, 2016

Three text-rotation-alignment tests in the test-suite are rendering differently than gl-js. This is fallout of #6253 but appears to be related to the placement algorithm or symbol-spacing rather than text-rotation-alignment itself.

text-rotation-alignment/{auto,map}-symbol-placement-line

These two tests are expected to produce the same output.

Expected (with/without collison debug):

image image

Actual (with/without collison debug):

image image

text-rotation-alignment/viewport-symbol-placement-line

Expected (with/without collison debug):

image image

Actual (with/without collison debug):

image image

@jfirebaugh jfirebaugh added tests Core The cross-platform C++ core, aka mbgl labels Sep 21, 2016
@jfirebaugh
Copy link
Contributor Author

It looks like the root of this problem may be the use of float rather than double for symbol layout properties such as text-line-height. The default value for text-line-height is 1.2, which cannot be represented precisely by a float. This cascades into significant errors in subsequent computations compared to gl-js, which is using doubles exclusively.

@jfirebaugh
Copy link
Contributor Author

Another issue is that native Shaping uses int32_t coordinates, while JS uses unrounded doubles.

@jfirebaugh
Copy link
Contributor Author

gl-native CollisionTile::minScale = 0.5f. gl-js CollisionTile.prototype.minScale = 0.25

@ansis is there any reason for these not to be the same? Should it be 0.25 or 0.5?

@jfirebaugh
Copy link
Contributor Author

Another float vs integer discrepancy, this one going in the opposite direction: gl-js round trips collision box coordinates through Int16, while native keeps them floating point.

@ansis
Copy link
Contributor

ansis commented Sep 22, 2016

is there any reason for these not to be the same? Should it be 0.25 or 0.5?

I think they should be the same.

I think 0.5 seems good. I think maybe it should be sharing a constant value with the minScale used in quads.js/cpp. But maybe they can be different and the CollisionTile version can be changed to 0 and eliminated completely?

The only thing I think this affects is whether labels are visible when you quickly zoom out and underscale a tile.

I don't think this should have any effect on placement in a tile's intended zoom range.

@jfirebaugh
Copy link
Contributor Author

Fixed by tweaking the test case. Using #3841 to track the above issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl tests
Projects
None yet
Development

No branches or pull requests

2 participants