Fix the issue of labels in centre will overlap when alignLabels switc… #1702
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.
Type of PR: bugfix
PR checklist:
Overview of change:
In the library, it splits all the labels into top and bottom parts (based on the center coordinate), then recalculates the fixed coordinates for both parts. The issue occurs when calculating the bottom part, as it doesn't consider the coordinate of the last label from the top part, which causes some of the first items in the bottom part to overlap with the last items in the top part.
What has been changed in this PR is that the last item from the top part is moved to the bottom part. This way, when calculating the coordinates for the first item in the bottom part, it checks the last top item and adds the label's height if there is an overlap.
Is there anything you'd like reviewers to focus on?