-
Notifications
You must be signed in to change notification settings - Fork 240
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
Automatic label anchor (rebased) #842
Conversation
52bbcee
to
c4f98e2
Compare
de15719
to
556dd49
Compare
f8e03b6
to
ae36dc7
Compare
e4db674
to
166c636
Compare
656690f
to
95c1201
Compare
Both @hjanetzek and me are happy with the state of this branch, @tallytalwar can you give a quick review on this. |
39eddae
to
fd7bcad
Compare
Will get to reviewing this soon. |
49b58e3
to
a0da5ae
Compare
- So anchor fallback state would be able to switch between different text alignments
- rename wait_occ to none state
squash: remove logs squash: fix post rebase
a0da5ae
to
3a0e912
Compare
squash: remove unused include
squashed: - parse label anchor style string only once - fix packing of active label quads - fixup: missing alignment from first anchor - use direct mapping between Align enum and m_textRangeIndex position - fixup: uninitialized variables
label could have been hidden for a few frames (trying all fallbacks). fading it out does not make sense then
squashed - cleanup: use initializer-list (required gcc >= 5)
- m_occludedLastFrame was necessary for _onlyTransitions pass which did not keep the m_occluded state of the previous frame (fixed with labels.cpp:83)
3a0e912
to
bb67c0e
Compare
There are a bunch of conceptual changes here, can we document these in the PR description please? Will help reviewing this and also for debugging in future. |
@tallytalwar added some notes to the PR description. |
@karimnaaji thinking about the fallback logic again: why not try the fallbacks immediately instead of waiting for the next frame? I'll see if this works. Edit: I guess this was just not possible before the changes of tile-label-placement got merged which introduced incremental collision testing. |
Good to go. |
Continuing at #893 |
Rebase of #806
anchor: top
,[right, bottom, left, top]
Optimizations
Don't use multiple sets of quads (for each anchor), follow up work going in Store width offsets instead of quad ranges for automatic anchors #862Bugs
- [ ] label offset does not work (check bubble-wrap with debug_all_labels)Notes:
Label now stores a set of Anchors which are defined by the anchor-style parameter
https://github.com/tangrams/tangram-es/pull/842/files#diff-7d439434d5d36de1c37a6cb2f01b81aaR37.
When a label got occluded (or couldn't be placed when its tile becomes active) the label state changes from
visible/(none) -> fallback
and the next anchor position is tried on the next frame until all positions have been tried or the label could be placed.https://github.com/tangrams/tangram-es/pull/842/files#diff-d66207e00a5f8416ddf6f8aea50052dcR284
A TextLabel now stores quads for left/right/center alignments which are chosen to match the currently active Anchor. https://github.com/tangrams/tangram-es/pull/842/files#diff-1fd6c9d719003eb34d010a7063a941e7R38, https://github.com/tangrams/tangram-es/pull/842/files#diff-4cb2204fedb2ba4ea43314c75ab033f0R204