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

Calculate text collision correctly #1532

Merged
merged 3 commits into from
May 13, 2015
Merged

Calculate text collision correctly #1532

merged 3 commits into from
May 13, 2015

Conversation

tmpsantos
Copy link
Contributor

Fixes #1465.

@tmpsantos
Copy link
Contributor Author

Please review.

@friedbunny
Copy link
Contributor

@tmpsantos you might also want to have a look at @ansis's new-labelling branch (#1139), it entirely refactors the collision code.

tmpsantos added 3 commits May 13, 2015 09:58
Also add a virtual setState() method to give subclasses a chance
to intercept the change of state. This will be used by VectorTileData
to release resources when the TileData becomes immutable.
We keep the Collision object alive longer because we need it
for the SymbolBuckets yet to be created in case more data
resources arrive. When the tile is no longer needed or if it
is completely parsed or obsolete (i.e. in a immutable state)
we throw the Collision object away.
In order to calculate the collision correctly, the layer ordering
matters. Because of that, when we find the first incomplete symbol
bucket, we stop processing any furter SymbolBucket.

The side effect of this change is, if the first SymbolBucket is the
last to receive its resources, we won't see any label at all on
the screen until the last moment, when everything will be draw at
once.
@kkaefer kkaefer force-pushed the 1465-text_collision branch from 4bc3843 to 3b92725 Compare May 13, 2015 08:00
kkaefer added a commit that referenced this pull request May 13, 2015
Calculate text collision correctly
@kkaefer kkaefer merged commit 42b626e into master May 13, 2015
@kkaefer kkaefer deleted the 1465-text_collision branch May 13, 2015 08:38
@kkaefer
Copy link
Member

kkaefer commented May 13, 2015

Next step is in #1539

kkaefer added a commit that referenced this pull request May 13, 2015
Calculate text collision correctly
@tmpsantos tmpsantos self-assigned this May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text collision not calculated properly
3 participants