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

Utils | Text | getWrappedText: Tweaking ellipsis logic #217

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

rokotyan
Copy link
Contributor

@rokotyan rokotyan commented Jun 1, 2023

This pull request contains changes to improve the handling of text overflow and forced line breaks in the text rendering component.

  • Refactoring hyphen use: Instead of directly using a hyphen - to indicate a forced line break, we're now using UNOVIS_TEXT_HYPHEN_CHARACTER_DEFAULT imported from styles/index. This provides better control and uniformity in the codebase.
  • Removal of Hyphen Character when the line ends with ellipsis to avoid situations like "long_broken_text- ...".
  • Incorporating ellipsis into the calculation of the string length to prevent text overflow.

These changes should improve the readability of text and provide better text overflow management.

P.S. I made these changes while I was working on the Annotations component, which is not ready yet but I would like to push the fixes to main already.

@rokotyan rokotyan requested a review from reb-dev June 1, 2023 20:23
@rokotyan rokotyan added enhancement New feature or request fix Bug fix labels Jun 1, 2023
@rokotyan rokotyan added this to the Release v1.2.0 milestone Jun 1, 2023
@rokotyan rokotyan merged commit 4969aa2 into main Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants