1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:47:29 +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
{
[Resolved]
private IMarkdownTextComponent parentTextComponent { get; set; }
private IMarkdownTextFlowComponent parentFlowComponent { get; set; }
private readonly LinkInline linkInline;
@ -31,16 +31,20 @@ namespace osu.Game.Overlays.Wiki.Markdown
[BackgroundDependencyLoader]
private void load()
{
MarkdownTextFlowContainer textFlow;
Children = new Drawable[]
{
new BlockMarkdownImage(linkInline),
parentTextComponent.CreateSpriteText().With(t =>
textFlow = parentFlowComponent.CreateTextFlow().With(t =>
{
t.Text = linkInline.Title;
t.Anchor = Anchor.TopCentre;
t.Origin = Anchor.TopCentre;
t.TextAnchor = Anchor.TopCentre;
}),
};
textFlow.AddText(linkInline.Title);
}
private class BlockMarkdownImage : WikiMarkdownImage