Search Unity

Canvas Scaler and Content Size Fitter (bug or feature?)

Discussion in 'UGUI & TextMesh Pro' started by pavlik1307, Aug 18, 2019.

  1. pavlik1307

    pavlik1307

    Joined:
    Jul 14, 2017
    Posts:
    8
    So, I want my UI to scale at different screen resolutions. I configured Canvas Scaler as follows:

    upload_2019-8-18_13-51-41.png

    I created a panel with text that looks good:

    upload_2019-8-18_13-53-5.png

    My panel has Vertical Layout Group and Content Size Fitter to fit the text inside:

    upload_2019-8-18_13-55-47.png

    In some cases at different resolutions text starts to wrap (1920x1080 in my case):

    upload_2019-8-18_13-58-32.png
     
  2. pavlik1307

    pavlik1307

    Joined:
    Jul 14, 2017
    Posts:
    8
    Does anyone have this issue?

    This is the main menu panel which has the following structure:

    Panel with Vertical Layout Group and Content Size Fitter the same as in my previous post
    Text with Text Wrap
    Three Buttons with Layout Element (preferred width and height are set)

    upload_2020-4-20_0-33-46.png

    You can see how text wraps depending on Canvas Scale Factor. It seems to be a bug in layout calculations.

    Bug.gif