[NUI] TextLayout can consider specified maximum width. (#2774)
authorJiyun Yang <ji.yang@samsung.com>
Tue, 23 Mar 2021 07:05:10 +0000 (16:05 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Tue, 30 Mar 2021 06:51:02 +0000 (15:51 +0900)
commit9f547926fb51d814c2d13ee59c548249dd1031ca
treeb739fc8fc9363c6461903edad15312b1a8da3b78
parent1f4943bd0356d09978e53706d3e5d5f881759f9b
[NUI] TextLayout can consider specified maximum width. (#2774)

Previsouly, the Layout system did not reflect TextLabel's maximum size, so the following example did't work corrrectly,

```C#
  var view = new View()
  {
    Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, },
  };
  view.Add(new TextLabel() { MaximumSize = new Size2D(50, 50), Text = "Helloooooooooooooooooo!" });
  view.Add(new TextLabel() { MaximumSize = new Size2D(50, 50), Text = "Helloooooooooooooooooo!" });
  NUIApplication.GetDefaultWindow().Add(view);
```

The x-position of the second child was calculated based on the first child's natutal width,
but the first child's actual width was limited by MaximumSize(50).

So this patch update the TextLabel's layout to make it consider the maxmimum size of the view.

Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
Co-authored-by: huiyueun <35286162+huiyueun@users.noreply.github.com>
src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs