mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
Apply more formal fix for alive state presence invalidations
This commit is contained in:
@@ -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[]
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user