14 private float _spacing;
15 private SizeF _contentSize;
29 PointF anchor =
default,
32 string? nickname =
null)
33 : base(renderSurfaceHost, mode, anchor, nickname)
35 _orientation = orientation;
52 if (_orientation == value)
68 if (!
float.IsFinite(value) || value < 0f)
69 throw new ArgumentOutOfRangeException(nameof(value));
88 ArgumentNullException.ThrowIfNull(widget);
89 Add(widget, keepCurrentOffset:
false, explicitLocalOffsetPx: Vector2.Zero);
101 ArgumentNullException.ThrowIfNull(widget);
119 for (
int index = 0; index < widgets.Length; index++)
123 ? widget.ScreenBounds
127 ?
new Vector2(0f, cursor)
128 :
new Vector2(cursor, 0f);
134 cursor += bounds.Height;
135 cross = Math.Max(cross, bounds.Width);
139 cursor += bounds.Width;
140 cross = Math.Max(cross, bounds.Height);
143 if (index < widgets.Length - 1)
148 ?
new SizeF(cross, cursor)
149 :
new SizeF(cursor, cross);
156 bool keepCurrentOffset =
true,
157 Vector2? explicitLocalOffsetPx =
null)
160 throw new ArgumentException(
"StackPanelWidget accepts widget children only.", nameof(child));
162 DirectComposite result = base.Add(child, keepCurrentOffset, explicitLocalOffsetPx);
DirectComposite SetLocalOffset(IDirectCompositeChild child, Vector2 newLocalOffsetPx)
Changes one child's local offset and reapplies its position.
Rectangle WorldBounds
Gets the union of all visible descendants' world-space bounds.
DirectComposite(RenderSurfaceHostBase renderSurfaceHost, DirectDrawingMode mode, PointF anchor=default, string? nickname=null)
Initializes a new instance of the DirectComposite class.
DirectDrawingMode Mode
Gets the coordinate mode shared by the composite and its children.
Represents a base class for hosting a render surface, providing functionality for managing rendering ...
Defines a movable direct drawable that may be owned by a DirectComposite.
DirectDrawingMode
Specifies where direct drawing operations are applied within the rendering pipeline.
@ View
Performs direct drawing at the view level using screen-space coordinates.