Change FontReference to reference type

FontReference is mutating itself by storing the cached font for later
reuse, but this is not working as intended because FontReference is
returned as a value type in UIControls so the cached font is actually
stored in a copy of the FontReference and not in the original property.
This commit is contained in:
GoaLitiuM
2021-04-03 13:38:11 +03:00
parent 1ec55ee088
commit 4bb703e9bf
2 changed files with 12 additions and 8 deletions

View File

@@ -135,7 +135,7 @@ namespace FlaxEditor.Windows.Assets
/// <inheritdoc />
protected override void UnlinkItem()
{
_textPreview.Font = new FontReference();
_textPreview.Font = null;
base.UnlinkItem();
}