1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:23:22 +08:00

add font size in HeadingTextFlowContainer

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-06-22 12:24:51 +07:00
parent f89c154e18
commit 5c3129f1a2
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -20,7 +20,8 @@ namespace osu.Game.Graphics.Containers.Markdown
public override MarkdownTextFlowContainer CreateTextFlow() => new HeadingTextFlowContainer
{
Weight = GetFontWeightByLevel(level),
FontSize = GetFontSizeByLevel(level),
FontWeight = GetFontWeightByLevel(level),
};
protected override float GetFontSizeByLevel(int level)
@ -65,9 +66,11 @@ namespace osu.Game.Graphics.Containers.Markdown
private class HeadingTextFlowContainer : OsuMarkdownTextFlowContainer
{
public FontWeight Weight { get; set; }
public float FontSize;
public FontWeight FontWeight;
protected override SpriteText CreateSpriteText() => base.CreateSpriteText().With(t => t.Font = t.Font.With(weight: Weight));
protected override SpriteText CreateSpriteText()
=> base.CreateSpriteText().With(t => t.Font = t.Font.With(size: FontSize, weight: FontWeight));
}
}
}