simplify CreateSpriteText in markdown heading

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-05-07 14:36:35 +07:00
parent 5b003750f8
commit 3524cb7924
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using Markdig.Syntax;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers.Markdown;
using osu.Framework.Graphics.Sprites;
@ -68,12 +69,7 @@ namespace osu.Game.Graphics.Containers.Markdown
{
public FontWeight Weight { get; set; }
protected override SpriteText CreateSpriteText()
{
var spriteText = base.CreateSpriteText();
spriteText.Font = spriteText.Font.With(weight: Weight);
return spriteText;
}
protected override SpriteText CreateSpriteText() => base.CreateSpriteText().With(t => t.Font = t.Font.With(weight: Weight));
}
}
}