From e6579352f9a3dda275d6fc5f7c313bec11837235 Mon Sep 17 00:00:00 2001 From: Gagah Pangeran Rosfatiputra Date: Fri, 30 Apr 2021 10:56:41 +0700 Subject: [PATCH] add left padding for ordered list In osu-md.less, this rule style[1] removes padding left in ordered list. But in this rule style[2], pseudo element `::before` is used as marker or counter and has minimal width 30px. So we use this as left padding size. [1] https://github.com/ppy/osu-web/blob/5b0e3ac3ffce6b1aff8c9a8794db56603e885ef8/resources/assets/less/bem/osu-md.less#L196-L200 [2] https://github.com/ppy/osu-web/blob/5b0e3ac3ffce6b1aff8c9a8794db56603e885ef8/resources/assets/less/bem/osu-md.less#L210-L219 --- .../Graphics/Containers/Markdown/OsuMarkdownListItem.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs b/osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs index b091e9ac07..b448ea154f 100644 --- a/osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs +++ b/osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs @@ -14,7 +14,9 @@ namespace osu.Game.Graphics.Containers.Markdown private readonly int level; private readonly int order; private readonly bool isOrdered; - private const float default_left_padding = 20; + + private const float ordered_left_padding = 30; + private const float unordered_left_padding = 20; [Resolved] private IMarkdownTextComponent parentTextComponent { get; set; } @@ -29,7 +31,7 @@ namespace osu.Game.Graphics.Containers.Markdown AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; - Padding = new MarginPadding { Left = default_left_padding }; + Padding = new MarginPadding { Left = isOrdered ? ordered_left_padding : unordered_left_padding }; InternalChildren = new Drawable[] {