Fix Label auto-height and auto-width when text overflows the lines and it's wrapped
#358
This commit is contained in:
@@ -239,7 +239,13 @@ namespace FlaxEngine.GUI
|
|||||||
if (font)
|
if (font)
|
||||||
{
|
{
|
||||||
// Calculate text size
|
// Calculate text size
|
||||||
_textSize = font.MeasureText(_text);
|
var layout = TextLayoutOptions.Default;
|
||||||
|
layout.TextWrapping = Wrapping;
|
||||||
|
if (_autoHeight && !_autoWidth)
|
||||||
|
layout.Bounds.Size.X = Width - Margin.Width;
|
||||||
|
else if (_autoWidth && !_autoHeight)
|
||||||
|
layout.Bounds.Size.Y = Height - Margin.Height;
|
||||||
|
_textSize = font.MeasureText(_text, ref layout);
|
||||||
|
|
||||||
// Check if size is controlled via text
|
// Check if size is controlled via text
|
||||||
if (_autoWidth || _autoHeight)
|
if (_autoWidth || _autoHeight)
|
||||||
|
|||||||
Reference in New Issue
Block a user