Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/GitHub.UI/Controls/ScrollingVerticalStackPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,25 @@ protected override Size ArrangeOverride(Size finalSize)
{
var isFixed = GetIsFixed(child);
var x = isFixed ? 0 : -HorizontalOffset;
var childRect = new Rect(x, y, child.DesiredSize.Width, child.DesiredSize.Height);
var width = child.DesiredSize.Width;

if (isFixed)
{
switch (child.HorizontalAlignment)
{
case HorizontalAlignment.Stretch:
width = finalSize.Width;
break;
case HorizontalAlignment.Right:
x = finalSize.Width - child.DesiredSize.Width;
break;
case HorizontalAlignment.Center:
x = (finalSize.Width - child.DesiredSize.Width) / 2;
break;
}
}

var childRect = new Rect(x, y, width, child.DesiredSize.Height);
child.Arrange(childRect);
y += child.DesiredSize.Height;

Expand Down