Move fallback rendering to new class
This commit is contained in:
@@ -476,7 +476,7 @@ namespace FlaxEngine.GUI
|
||||
var font = Font.GetFont();
|
||||
for (int i = 0; i < _items.Count; i++)
|
||||
{
|
||||
itemsWidth = Mathf.Max(itemsWidth, itemsMargin + 4 + Render2D.MeasureText(font, _items[i]).X);
|
||||
itemsWidth = Mathf.Max(itemsWidth, itemsMargin + 4 + FallbackTextUtils.MeasureText(font, _items[i]).X);
|
||||
}
|
||||
*/
|
||||
var itemsWidth = Width;
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace FlaxEngine.GUI
|
||||
layout.Bounds.Size.X = Width - Margin.Width;
|
||||
else if (_autoWidth && !_autoHeight)
|
||||
layout.Bounds.Size.Y = Height - Margin.Height;
|
||||
_textSize = Render2D.MeasureText(font, _text, ref layout);
|
||||
_textSize = FallbackTextUtils.MeasureText(font, _text, ref layout);
|
||||
_textSize.Y *= BaseLinesGapScale;
|
||||
|
||||
// Check if size is controlled via text
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace FlaxEngine.GUI
|
||||
return Float2.Zero;
|
||||
}
|
||||
|
||||
return Render2D.MeasureText(font, _text, ref _layout);
|
||||
return FallbackTextUtils.MeasureText(font, _text, ref _layout);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user