1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 18:27:26 +08:00

handle list padding in OsuMarkdownListItem

Reference : 5b0e3ac3ff/resources/assets/less/bem/osu-md.less (L193-L194)
This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-04-30 09:47:25 +07:00
parent a24a279404
commit 1e8b3f3a8c
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2
2 changed files with 9 additions and 0 deletions

View File

@ -6,6 +6,7 @@ using Markdig.Extensions.AutoIdentifiers;
using Markdig.Extensions.Tables;
using Markdig.Extensions.Yaml;
using Markdig.Syntax;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Containers.Markdown;
@ -44,6 +45,11 @@ namespace osu.Game.Graphics.Containers.Markdown
protected override MarkdownTable CreateTable(Table table) => new OsuMarkdownTable(table);
protected override MarkdownList CreateList(ListBlock listBlock) => new MarkdownList
{
Padding = new MarginPadding(0)
};
protected virtual OsuMarkdownListItem CreateListItem(ListItemBlock listItemBlock) => new OsuMarkdownListItem();
protected override MarkdownPipeline CreateBuilder()

View File

@ -9,6 +9,8 @@ namespace osu.Game.Graphics.Containers.Markdown
{
public class OsuMarkdownListItem : FillFlowContainer
{
private const float default_left_padding = 20;
public OsuMarkdownListItem()
{
AutoSizeAxes = Axes.Y;
@ -16,6 +18,7 @@ namespace osu.Game.Graphics.Containers.Markdown
Direction = FillDirection.Vertical;
Spacing = new Vector2(10, 10);
Padding = new MarginPadding { Left = default_left_padding };
}
}
}