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

Use LayoutSize for header and footer layout.

This commit is contained in:
Huo Yaoyuan 2017-05-21 04:01:07 +08:00
parent 35712514a4
commit a98f109d73

View File

@ -130,8 +130,8 @@ namespace osu.Game.Graphics.Containers
{ {
base.UpdateAfterChildren(); base.UpdateAfterChildren();
float headerHeight = (ExpandableHeader?.Height ?? 0) + (FixedHeader?.Height ?? 0); float headerHeight = (ExpandableHeader?.LayoutSize.Y ?? 0) + (FixedHeader?.LayoutSize.Y ?? 0);
float footerHeight = Footer?.Height ?? 0; float footerHeight = Footer?.LayoutSize.Y ?? 0;
if (headerHeight != this.headerHeight || footerHeight != this.footerHeight) if (headerHeight != this.headerHeight || footerHeight != this.footerHeight)
{ {
this.headerHeight = headerHeight; this.headerHeight = headerHeight;
@ -146,10 +146,10 @@ namespace osu.Game.Graphics.Containers
if (expandableHeader != null && fixedHeader != null) if (expandableHeader != null && fixedHeader != null)
{ {
float offset = Math.Min(expandableHeader.Height, currentScroll); float offset = Math.Min(expandableHeader.LayoutSize.Y, currentScroll);
expandableHeader.Y = -offset; expandableHeader.Y = -offset;
fixedHeader.Y = -offset + expandableHeader.Height; fixedHeader.Y = -offset + expandableHeader.LayoutSize.Y;
} }
Drawable bestMatch = null; Drawable bestMatch = null;