1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:43:10 +08:00

update height to max of its parent height

This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-05-23 21:42:58 +07:00
parent 24960c4fb8
commit bd1454bdd1
No known key found for this signature in database
GPG Key ID: 25F6F17FD29031E2

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System;
using Markdig.Syntax; using Markdig.Syntax;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
@ -23,6 +24,8 @@ namespace osu.Game.Overlays.Wiki
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } private OverlayColourProvider colourProvider { get; set; }
private WikiPanelMarkdownContainer panelContainer;
public string Text; public string Text;
public bool IsFullWidth; public bool IsFullWidth;
@ -30,7 +33,6 @@ namespace osu.Game.Overlays.Wiki
public WikiPanelContainer() public WikiPanelContainer()
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Padding = new MarginPadding(3); Padding = new MarginPadding(3);
} }
@ -57,7 +59,7 @@ namespace osu.Game.Overlays.Wiki
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
}, },
new WikiPanelMarkdownContainer panelContainer = new WikiPanelMarkdownContainer
{ {
Text = Text, Text = Text,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -67,6 +69,12 @@ namespace osu.Game.Overlays.Wiki
}; };
} }
protected override void Update()
{
base.Update();
Height = Math.Max(panelContainer.Height, Parent.DrawHeight);
}
private class WikiPanelMarkdownContainer : WikiMarkdownContainer private class WikiPanelMarkdownContainer : WikiMarkdownContainer
{ {
public bool IsFullWidth; public bool IsFullWidth;