Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Odd line break behavior in text with Overflow=Linked

Discussion in 'UGUI & TextMesh Pro' started by Oskiii, Feb 12, 2021.

  1. Oskiii

    Oskiii

    Joined:
    Feb 23, 2016
    Posts:
    13
    See video:


    When Overflow is set to Linked, linebreaks in the text (\n or <br>) don't work as expected. This is causing my text to ignore linebreaks if they happen to line up with the edge of the text box. Without the Linked setting the line breaks work as expected (each \n or <br> makes the following text drop down one line)

    To reproduce:
    1. Create two text fields on top of each other and set the top one's overflow to be Linked and link it to the lower one
    2. Input text into the text box
    3. Let text flow into the text boxes so it overflows into the second one
    4. Insert a line break in the text where the text transfers to the next text box
    5. Observe behavior

    Expected:
    Line breaks in text in linked boxes behave the same as in boxes with other overflow settings.

    Is there a workaround for this?
     
  2. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    I am also experience this same thing with the line breaks. I'm working on Unity 2019.4.17f1. I'm using TextMeshPro version 2.1.3.

    Another bug I am seeing is where a character from the last line before the link occurs carries over...for example, in my screenshot attached, you'll see the "n" carry over from the word "an".
     

    Attached Files:

  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I'll try looking into this over the weekend.

    Please do not hesitate to bump the post if I fail to follow up by early next week.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Just had a chance to take a closer look at this earlier today.

    I was able to reproduce the issues outlined above and to resolve them.

    The change will be included in the next release of the TMP package which I will try to release tomorrow.
     
  5. Oskiii

    Oskiii

    Joined:
    Feb 23, 2016
    Posts:
    13
    Thank you, Stephan!
     
  6. sincerelysleepy

    sincerelysleepy

    Joined:
    Jan 15, 2019
    Posts:
    34
    Wow killer work!