This document captures design and implementation notes for HStack.
For end-user usage and examples, see HStack.
HStack : Panel (sealed)HStack() sets HorizontalAlignment = Align.Start.HStack(params Visual[] children) sets alignment and adds the children.Spacing : int
>= 0)For N children and spacing = max(0, Spacing):
totalSpacing = spacing * max(0, N - 1)MinHeight/MaxHeight)MinWidth = 0) and bounded above (MaxWidth)Min.Width / Natural.Width are the sum across children plus totalSpacingMax.Width is the sum of max widths (or infinite if any child max width is infinite)Min.Height / Natural.Height / Max.Height are based on the maximum height across childrenFlexGrowX / FlexShrinkX are the sum across childrenThe result is normalized via SizeHints.Normalize().
Arrange allocates each child width using FlexAllocator.Allocate(...):
finalRect.Width - totalSpacingMeasureHints (min/natural/max + grow/shrink on X)finalRect.Height)x offsets with Spacing columns between childrenHStack has no dedicated style and does not render anything itself; children render normally.HStack is exercised broadly through layout protocol tests and ControlsDemo layouts.