Files
sbox-public/engine/Sandbox.Engine/Systems/UI/Data/LayoutCascade.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

44 lines
911 B
C#

namespace Sandbox.UI;
public struct LayoutCascade
{
public bool SelectorChanged;
public bool ParentChanged;
public bool SkipTransitions;
public Styles ParentStyles;
internal RootPanel Root;
//
// Cascading Properties
//
public float Scale;
/// <summary>
/// Some properties cascade from their parent onto children if the children
/// don't set them. Things like font size, color, cursor.
/// </summary>
internal void ApplyCascading( Styles cached )
{
if ( ParentStyles == null )
return;
cached.ApplyCascading( ParentStyles );
if ( cached.TextShadow.Count == 0 )
{
if ( ParentStyles.TextShadow.Count != 0 )
cached.TextShadow.AddRange( ParentStyles.TextShadow );
}
if ( cached.TextGradient.ColorOffsets.IsDefaultOrEmpty )
{
if ( !ParentStyles.TextGradient.ColorOffsets.IsDefaultOrEmpty )
{
cached.TextGradient = ParentStyles.TextGradient;
}
}
}
}