internal virtual void UpdateSubTree() { transformationDelay = 0; //todo: this should be moved to after the IsVisible condition once we have TOL for transformations (and some better logic). updateTransformations(); if (!IsVisible) { return; } Update(); OnUpdate?.Invoke(); // This check is conservative in the sense, that autosize containers do not impose // any masking on children. This is valid under the assumption, that autosize // will always adjust its size such that it does not mask children away. // todo: Fix for AlwaysDraw == false (never get to UpdateResult.Discard case below) //if (IsMaskedOut()) // return updateResult = UpdateResult.ShouldNotDraw; updateDepthChanges(); internalChildren.Update(Time); foreach (Drawable child in internalChildren.Current) { child.UpdateSubTree(); } UpdateLayout(); }
public bool UpdateSubTree() { if (LoadState < LoadState.Alive) { if (!LoadComplete()) { return(false); } } children.Update(Time); transformationDelay = 0; UpdateTransforms(); foreach (var child in Children) { child.UpdateSubTree(); } if (!IsVisible) { return(true); } Update(); return(true); }
/// <summary> /// Process updates to this drawable based on loaded transforms. /// </summary> /// <returns>Whether we should draw this drawable.</returns> private void updateTransforms() { var removed = transforms.Update(Time); foreach (ITransform t in removed) { t.Apply(this); //make sure we apply one last time. } foreach (ITransform t in transforms.Current) { t.Apply(this); } }
/// <summary> /// Process updates to this drawable based on loaded transforms. /// </summary> /// <returns>Whether we should draw this drawable.</returns> private void updateTransforms() { if (transforms == null || transforms.Count == 0) { return; } transforms.Update(Time); foreach (ITransform t in transforms.AliveItems) { t.Apply(this); } }
/// <summary> /// Updates the life status of children according to their IsAlive property. /// </summary> /// <returns>True iff the life status of at least one child changed.</returns> protected virtual bool UpdateChildrenLife() { bool childChangedStatus = false; foreach (Drawable child in children) { bool isAlive = child.IsAlive; if (isAlive != child.wasAliveLastUpdate) { child.wasAliveLastUpdate = isAlive; childChangedStatus = true; } } children.Update(Time); return(childChangedStatus); }
/// <summary> /// Updates the life status of children according to their IsAlive property. /// </summary> /// <returns>True iff the life status of at least one child changed.</returns> protected virtual bool UpdateChildrenLife() { return(children.Update()); }