Move fallback rendering to new class

This commit is contained in:
ExMatics HydrogenC
2023-11-30 23:22:11 +08:00
parent cdbe59a3fb
commit 623f478b44
30 changed files with 165 additions and 217 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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 />