Apply more formal fix for alive state presence invalidations

This commit is contained in:
smoogipoo
2020-02-27 11:10:17 +09:00
parent a53a93a4e1
commit efdbe72c94
2 changed files with 14 additions and 7 deletions

View File

@@ -27,6 +27,8 @@ namespace osu.Framework.Tests.Layout.GridContainerLayout
Child = parent = new GridContainer
{
AutoSizeAxes = Axes.Both,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{
new Drawable[]
@@ -60,6 +62,8 @@ namespace osu.Framework.Tests.Layout.GridContainerLayout
Child = parent = new GridContainer
{
AutoSizeAxes = Axes.Both,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{
new Drawable[]
@@ -89,6 +93,8 @@ namespace osu.Framework.Tests.Layout.GridContainerLayout
Child = parent = new GridContainer
{
AutoSizeAxes = Axes.Both,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{
new Drawable[]

View File

@@ -663,9 +663,6 @@ namespace osu.Framework.Graphics.Containers
FrameStatistics.Add(StatisticsCounterType.CCL, internalChildren.Count);
if (anyAliveChanged)
childrenSizeDependencies.Invalidate();
return anyAliveChanged;
}
@@ -750,9 +747,9 @@ namespace osu.Framework.Graphics.Containers
aliveInternalChildren.Add(child);
child.IsAlive = true;
Invalidate(Invalidation.Presence, InvalidationSource.Child);
ChildBecameAlive?.Invoke(child);
Invalidate(Invalidation.Presence, InvalidationSource.Child);
}
/// <summary>
@@ -772,6 +769,8 @@ namespace osu.Framework.Graphics.Containers
ChildDied?.Invoke(child);
bool removed = false;
if (child.RemoveWhenNotAlive)
{
RemoveInternal(child);
@@ -779,10 +778,12 @@ namespace osu.Framework.Graphics.Containers
if (child.DisposeOnDeathRemoval)
DisposeChildAsync(child);
return true;
removed = true;
}
return false;
Invalidate(Invalidation.Presence, InvalidationSource.Child);
return removed;
}
internal override void UnbindAllBindablesSubTree()