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

Merge pull request #13899 from gagahpangeran/image-caption-tfc

This commit is contained in:
Dean Herbert 2021-07-16 19:15:09 +09:00 committed by GitHub
commit 01c9e9adcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ namespace osu.Game.Overlays.Wiki.Markdown
public class WikiMarkdownImageBlock : FillFlowContainer public class WikiMarkdownImageBlock : FillFlowContainer
{ {
[Resolved] [Resolved]
private IMarkdownTextComponent parentTextComponent { get; set; } private IMarkdownTextFlowComponent parentFlowComponent { get; set; }
private readonly LinkInline linkInline; private readonly LinkInline linkInline;
@ -31,16 +31,20 @@ namespace osu.Game.Overlays.Wiki.Markdown
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
MarkdownTextFlowContainer textFlow;
Children = new Drawable[] Children = new Drawable[]
{ {
new BlockMarkdownImage(linkInline), new BlockMarkdownImage(linkInline),
parentTextComponent.CreateSpriteText().With(t => textFlow = parentFlowComponent.CreateTextFlow().With(t =>
{ {
t.Text = linkInline.Title;
t.Anchor = Anchor.TopCentre; t.Anchor = Anchor.TopCentre;
t.Origin = Anchor.TopCentre; t.Origin = Anchor.TopCentre;
t.TextAnchor = Anchor.TopCentre;
}), }),
}; };
textFlow.AddText(linkInline.Title);
} }
private class BlockMarkdownImage : WikiMarkdownImage private class BlockMarkdownImage : WikiMarkdownImage