1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 17:57:29 +08:00
osu-lazer/osu.Game/Overlays/Comments/CommentMarkdownContainer.cs

47 lines
1.4 KiB
C#
Raw Normal View History

2021-07-26 19:18:33 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-06-17 15:37:17 +08:00
#nullable disable
2021-07-26 22:07:35 +08:00
using Markdig.Syntax;
2021-07-26 19:18:33 +08:00
using osu.Framework.Graphics.Containers.Markdown;
using osu.Game.Graphics.Containers.Markdown;
namespace osu.Game.Overlays.Comments
{
2022-11-24 13:32:20 +08:00
public partial class CommentMarkdownContainer : OsuMarkdownContainer
2021-07-26 19:18:33 +08:00
{
2022-12-20 03:16:36 +08:00
protected override OsuMarkdownContainerOptions Options => new OsuMarkdownContainerOptions
{
Autolinks = true
};
2021-07-26 22:07:35 +08:00
protected override MarkdownHeading CreateHeading(HeadingBlock headingBlock) => new CommentMarkdownHeading(headingBlock);
2022-11-24 13:32:20 +08:00
private partial class CommentMarkdownHeading : OsuMarkdownHeading
2021-07-26 22:07:35 +08:00
{
public CommentMarkdownHeading(HeadingBlock headingBlock)
: base(headingBlock)
{
}
protected override float GetFontSizeByLevel(int level)
{
float defaultFontSize = base.GetFontSizeByLevel(6);
2021-07-26 22:07:35 +08:00
switch (level)
{
case 1:
return 1.2f * defaultFontSize;
case 2:
return 1.1f * defaultFontSize;
default:
return defaultFontSize;
}
}
}
2021-07-26 19:18:33 +08:00
}
}