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.
  2. Dismiss Notice

3.2.0-preview 1 labels won't recover after scale is being set to 0

Discussion in 'UGUI & TextMesh Pro' started by swang_hothead, Oct 1, 2021.

  1. swang_hothead

    swang_hothead

    Joined:
    Jul 15, 2019
    Posts:
    6
    As described in the title, if you set a label's scale to (0,0,0) and then set it back to something correct, it's still showing blank squares without other modification (enable/disable for example). This is new to 3.2.0-preview1.

    In the frame debugger, it says canvas renderer does not have a texture assigned. I am going to do more debugging and see what's missing/changed.
     
  2. swang_hothead

    swang_hothead

    Joined:
    Jul 15, 2019
    Posts:
    6
    Code (CSharp):
    1. if (m_havePropertiesChanged == false)
    2. {
    3.     float lossyScaleY = m_rectTransform.lossyScale.y;
    4.     if (m_previousLossyScaleY != 0 && m_TextProcessingArray[0].unicode != 0)
    5.     {
    6.         float scaleDelta = lossyScaleY / m_previousLossyScale;
    7.         // Only update SDF Scale when lossy scale has changed by more than 20%
    8.         if (scaleDelta < 0.8f || scaleDelta > 1.25f)
    9.         {
    10.             UpdateSDFScale(scaleDelta);
    11.             m_previousLossyScaleY = lossyScaleY;
    12.         }
    13.     }
    14. }
    This is the current code in TMPro_UGUI_Private.cs.InternalUpdate()

    Code (CSharp):
    1. if (m_havePropertiesChanged == false)
    2. {
    3.     float lossyScaleY = m_rectTransform.lossyScale.y;
    4.     if (lossyScaleY != m_previousLossyScaleY && m_text != string.Empty && m_text != null)
    5.     {
    6.         float scaleDelta = lossyScaleY / m_previousLossyScale;
    7.         UpdateSDFScale(scaleDelta);
    8.         m_previousLossyScaleY = lossyScaleY;
    9.     }
    10. }
    And this is the code i think in version we use previously

    So when m_previousLossyScaleY being set to 0, there is no way to make UpdateSDFScale called again.
     
    Last edited: Oct 1, 2021
  3. swang_hothead

    swang_hothead

    Joined:
    Jul 15, 2019
    Posts:
    6
    Code (CSharp):
    1. if (m_havePropertiesChanged == false)
    2. {
    3.     float lossyScaleY = m_rectTransform.lossyScale.y;
    4.     if (m_TextProcessingArray[0].unicode != 0)
    5.     {
    6.         if (m_previousLossyScaleY != 0)
    7.         {
    8.             float scaleDelta = lossyScaleY / m_previousLossyScaleY;
    9.             // Only update SDF Scale when lossy scale has changed by more than 20%
    10.             if (scaleDelta < 0.8f || scaleDelta > 1.25f)
    11.             {
    12.                 UpdateSDFScale(scaleDelta);
    13.                 m_previousLossyScaleY = lossyScaleY;
    14.             }
    15.         }
    16.         else if (lossyScaleY > 0)
    17.         {
    18.             UpdateSDFScale(float.PositiveInfinity);
    19.             m_previousLossyScaleY = lossyScaleY;
    20.         }
    21.         else if (lossyScaleY < 0)
    22.         {
    23.             UpdateSDFScale(float.NegativeInfinity);
    24.             m_previousLossyScaleY = lossyScaleY;
    25.         }
    26.     }
    27. }
    Fix the issue by changing it to this
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Known issue that will be addressed in preview 2.
     
    swang_hothead likes this.
  5. swang_hothead

    swang_hothead

    Joined:
    Jul 15, 2019
    Posts:
    6
    Is there a list of known issues somewhere? And also do you have an ETA for preview 2? Great thanks!

    I really like the dynamic OS feature but wasn't too sure we can release with this preview version if it has many issues.
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This issue is kind of the only regression that has been reported. There are a few reported issues related to the Input Field but those are not specific to the new preview releases. Nothing major reported about the new features from users but a few that I caught (but nothing major).

    I will try to get preview 2 released next week. I had a potential preview 2 ready to go but then decided to add support for Ligatures so that pushed it back.