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

TextAnnotations - One line of text Justification bug #7680

Closed
claudiaareneee opened this issue Feb 10, 2025 · 1 comment · Fixed by #7685
Closed

TextAnnotations - One line of text Justification bug #7680

claudiaareneee opened this issue Feb 10, 2025 · 1 comment · Fixed by #7685
Labels

Comments

@claudiaareneee
Copy link
Contributor

claudiaareneee commented Feb 10, 2025

Describe the bug

When width is not 0, but there is no word wrapping, text does not justify.

To Reproduce

  1. Launch display test app.
  2. Open an iModel that has a font.
    • To see if there's a font, you can run await iModelAppForDebugger.viewManager.selectedView.iModel.loadFontMap() in the console
  3. Find a visible category
    • Run iModelAppForDebugger.viewManager.selectedView.view.categorySelector.categories in the console, and select one
  4. I'm in a 2d view, but the same applies for 3d.
  5. Run the following keyins
    1. dta text init
    2. dta text debug
    3. dta text center
    4. dta text text "Hi, I won't justify"
    5. dta text width 30
    6. dta text justify center
    7. dta text justify right
    8. dta text break
    9. dta text text "But I will"
    10. dta text justify center

Expected behavior

I want justification to occur even when there's only one line of text.

Screenshots

Justify.bug.mp4

Desktop (please complete the applicable information):

  • OS: macOS Sequoia
  • Electron
  • iTwin.js Version: 4.10.6
    • I'm on main, but I pulled like a week ago.

Additional context

I have a fix for it. It's like a one line change. I can make the PR.

@pmconne
Copy link
Member

pmconne commented Feb 10, 2025

Then, see video :)

Please write down your repro steps. Please also include all relevant information/data (e.g., you appear to have opened an iModel and a drawing within it).

Boiling down the issue to a simple unit test that reproduces the problem is a very good approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants