14 private float _spacing;
15 private SizeF _contentSize;
30 PointF anchor =
default,
33 string? nickname =
null)
40 _orientation = orientation;
57 if (_orientation == value)
73 if (!
float.IsFinite(value) || value < 0f)
74 throw new ArgumentOutOfRangeException(nameof(value));
93 ArgumentNullException.ThrowIfNull(widget);
94 Add(widget, keepCurrentOffset:
false, explicitLocalOffsetPx: Vector2.Zero);
106 ArgumentNullException.ThrowIfNull(widget);
124 for (
int index = 0; index < widgets.Length; index++)
129 ? widget.ScreenBounds
133 ?
new Vector2(0f, cursor)
134 :
new Vector2(cursor, 0f);
140 cursor += bounds.Height;
141 cross = Math.Max(cross, bounds.Width);
145 cursor += bounds.Width;
146 cross = Math.Max(cross, bounds.Height);
149 if (index < widgets.Length - 1)
154 ?
new SizeF(cross, cursor)
155 :
new SizeF(cursor, cross);
163 bool keepCurrentOffset =
true,
164 Vector2? explicitLocalOffsetPx =
null)
167 throw new ArgumentException(
"StackPanelWidget accepts widget children only.", nameof(child));
169 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.