This document captures design and implementation notes for VStack.
For end-user usage and examples, see VStack.
VStack : Panel (sealed)VStack() sets VerticalAlignment = Align.Start.VStack(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)MinWidth/MaxWidth)MinHeight = 0) and bounded above (MaxHeight)Min.Width / Natural.Width / Max.Width are based on the maximum width across childrenMin.Height / Natural.Height are the sum across children plus totalSpacingMax.Height is the sum of max heights (or infinite if any child max height is infinite)FlexGrowY / FlexShrinkY are the sum across childrenThe result is normalized via SizeHints.Normalize().
Arrange allocates each child height using FlexAllocator.Allocate(...):
finalRect.Height - totalSpacingMeasureHints (min/natural/max + grow/shrink on Y)finalRect.Width)y offsets with Spacing rows between childrenVStack has no dedicated style and does not render anything itself; children render normally.VStack is exercised broadly through layout protocol tests and ControlsDemo layouts.