mirror of
https://github.com/ppy/osu
synced 2025-02-11 07:37:26 +00:00
use text flow in markdown image caption
This commit is contained in:
parent
b390562232
commit
8541e73fc1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user