fix: prevent infinite looping when polygon labels displayed on rotated map #2054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This #2052 fix is made of 2 separate parts.
One part is saying "No!" to forever loops: we assume that after trying to display on multiple worlds, if we keep trying it's because we'll never get an exit permit. And in that case we send an exception, which is slightly more refined than an ANR.
The second part deals more specifically with labels.
Only in the "no rotation" case we computed if the label was visible or not.
That means that in all non-0 rotation cases, we presumed that the label was visible, hence the forever loops.
Now we roughly compute cases when the label is invisible in all rotations. No more forever loops for labels.