Browse Source

Don't apply layout constraints to child.

The child itself will take care of applying its own layout constraints, applying them in the `ContentPresenter` arrange causes #1447.

Fixes #1447.
pull/1449/head
Steven Kirk 8 years ago
parent
commit
0c94c82b42
  1. 6
      src/Avalonia.Controls/Presenters/ContentPresenter.cs

6
src/Avalonia.Controls/Presenters/ContentPresenter.cs

@ -221,7 +221,7 @@ namespace Avalonia.Controls.Presenters
{
var content = Content;
var oldChild = Child;
var newChild = CreateChild();
var newChild = CreateChild();
// Remove the old child if we're not recycling it.
if (oldChild != null && newChild != oldChild)
@ -397,8 +397,6 @@ namespace Avalonia.Controls.Presenters
size = size.WithHeight(Math.Min(size.Height, DesiredSize.Height - padding.Top - padding.Bottom));
}
size = LayoutHelper.ApplyLayoutConstraints(Child, size);
if (useLayoutRounding)
{
size = new Size(
@ -412,7 +410,6 @@ namespace Avalonia.Controls.Presenters
switch (horizontalContentAlignment)
{
case HorizontalAlignment.Center:
case HorizontalAlignment.Stretch:
originX += (availableSizeMinusMargins.Width - size.Width) / 2;
break;
case HorizontalAlignment.Right:
@ -423,7 +420,6 @@ namespace Avalonia.Controls.Presenters
switch (verticalContentAlignment)
{
case VerticalAlignment.Center:
case VerticalAlignment.Stretch:
originY += (availableSizeMinusMargins.Height - size.Height) / 2;
break;
case VerticalAlignment.Bottom:

Loading…
Cancel
Save