Search Unity

Bug TMP 3.2.0-pre.4 incorrectly calculating line height when using <size> tag

Discussion in 'UGUI & TextMesh Pro' started by Menion-Leah, Apr 19, 2023.

  1. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    We recently upgraded to TextMesh Pro 3.2.0-pre.4,
    and we immediately noticed some text not behaving correctly.

    Upon further investigation, we found the culprit was the <size> tag: if the modifier affects an entire line of text, the lines above and below it experience an improper line height (smaller than expected if the tag is reducing the text size, larger if the tag is increasing it).

    You can see this behavior in action in the following image:

     
    HugoBD-Unity likes this.
  2. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    To clarify further: this affects size calculation used in ContentSizeFitter and XxxLayoutGroup, that now fail to properly accomodate text.

    Steps to reproduce:
    • Inside a UI Canvas, create a new Panel
    • Add a ContentSizeFitter and set Horizontal and Vertical Fit to Preferred Size
    • Add a VerticalLayoutGroup and check “Control Child Size > Height”
    • Inside the Panel, create a new TMP UI Text
    • Set text to:
      First line
      <size=30%>second line</size>
      third line

      and notice how it fails to adapt correctly
    • Set text to:
      First line
      <size=30%>second line</size> normal size
      third line

      and notice how it works properly
     
    Last edited: May 10, 2023
  3. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Bump

    I manually submitted a bug report 5 days ago, I never got a confirmation email and it doesn't show up on https://fogbugz.unity3d.com/

    Is that normal?
     
    Unifikation likes this.
  4. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    I'm still speechless seeing how little Unity cares about QA.

    We spot a bug, we find the steps to reproduce it, no one cares.
    Forum threads are ignored, bug reports don't go through, probably due to some other bugs.

    If it were the first time something similar happened, I'd be still willing to help and investigate... but it looks like things just got worse and worse since Unity 2017.
     
  5. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    I am pretty sure the creator of TMP is not working on tmp anymore so it might be harder to get answers :(
     
  6. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Hi @Menion-Leah! Thanks for logging the issue, it is extremely helpful to us. Can you paste the ticket number, I'll have a look and see if I can help get it unstuck.
     
  7. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Thanks for your help, @HugoBD-Unity!

    Unfortunately, I never got any ticket number: I tried twice, last time was yesterday, never got any email back (yep, I checked spam folder).



    Unity 2020.3.46f1, Help > Report a Bug...

    The report itself shouldn't be critical, though: there's no need to attach a project since it can be reproduced with the very few steps detailed in the second post here.
     
  8. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Apologies - upon re-checking I noticed the email was actually received, with a significant delay, in the spam folder.

    Request ID is IN-40596

    They requested more info from my end - I'm going to submit them and I'll keep you posted in this thread.
     
    Last edited: May 10, 2023
  9. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    499
    Menion-Leah likes this.
  10. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Hi @HugoBD-Unity ,
    I just noticed you closed the issue with a "Won't fix" status, providing a somewhat cryptic explanation in the resolution note:
    Ensure PreferredHeight handles various line height correctly
    Can you please elaborate more? I don't get how this is related to the bug I submitted and has been successfully reproduced as a regression. Thanks.