Skip to content
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

Release #1889

Merged
merged 2 commits into from
Jan 2, 2025
Merged

Release #1889

merged 2 commits into from
Jan 2, 2025

Conversation

lvisei
Copy link
Member

@lvisei lvisei commented Jan 2, 2025

No description provided.

Copy link

Walkthrough: This pull request addresses a bug related to multi-line text wrapping in the @antv/g-lite package. It includes changes to the text wrapping logic in the TextService and updates to the test cases to ensure correct functionality.

Changes:

Files Summary
.changeset/popular-items-wave.md Added a changeset note for a patch fix on multi-line text wrapping.
tests/demos/bugfix/textWordWrap.ts Modified test cases to adjust wordWrapWidth and added new test cases for multi-line text wrapping.
packages/g-lite/src/services/TextService.ts Refactored text wrapping logic to fix issues with character indexing and line width calculation.
🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

@@ -446,6 +453,7 @@ export class TextService {
break;
}

prevLineLastCharIndex = i - 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The introduction of prevLineLastCharIndex is a critical change to ensure that the character indexing is correctly managed across lines. This prevents potential off-by-one errors when calculating line breaks.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@lvisei lvisei merged commit bc84b68 into next Jan 2, 2025
5 checks passed
@lvisei lvisei deleted the release branch January 2, 2025 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants