|
|
|
@ -40,5 +40,59 @@ namespace Avalonia.Direct2D1.RenderTests.Controls |
|
|
|
await RenderToFile(target); |
|
|
|
CompareImages(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Win32Fact("Has text")] |
|
|
|
public async Task RestrictedHeight_VerticalAlign() |
|
|
|
{ |
|
|
|
IControl text(VerticalAlignment verticalAlingnment, bool clip = true, bool restrictHeight = true) |
|
|
|
{ |
|
|
|
return new Border() |
|
|
|
{ |
|
|
|
BorderBrush = Brushes.Blue, |
|
|
|
BorderThickness = new Thickness(1), |
|
|
|
VerticalAlignment = VerticalAlignment.Center, |
|
|
|
HorizontalAlignment = HorizontalAlignment.Center, |
|
|
|
Height = restrictHeight ? 20 : double.NaN, |
|
|
|
Margin = new Thickness(1), |
|
|
|
Child = new TextBlock |
|
|
|
{ |
|
|
|
FontFamily = new FontFamily("Courier New"), |
|
|
|
Background = Brushes.Red, |
|
|
|
FontSize = 24, |
|
|
|
Foreground = Brushes.Black, |
|
|
|
Text = "L", |
|
|
|
VerticalAlignment = verticalAlingnment, |
|
|
|
ClipToBounds = clip |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
Decorator target = new Decorator |
|
|
|
{ |
|
|
|
Padding = new Thickness(8), |
|
|
|
Width = 180, |
|
|
|
Height = 80, |
|
|
|
|
|
|
|
Child = new StackPanel() |
|
|
|
{ |
|
|
|
Orientation = Orientation.Horizontal, |
|
|
|
Children = |
|
|
|
{ |
|
|
|
text(VerticalAlignment.Stretch, restrictHeight: false), |
|
|
|
text(VerticalAlignment.Center), |
|
|
|
text(VerticalAlignment.Stretch), |
|
|
|
text(VerticalAlignment.Top), |
|
|
|
text(VerticalAlignment.Bottom), |
|
|
|
text(VerticalAlignment.Center, clip:false), |
|
|
|
text(VerticalAlignment.Stretch, clip:false), |
|
|
|
text(VerticalAlignment.Top, clip:false), |
|
|
|
text(VerticalAlignment.Bottom, clip:false), |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
await RenderToFile(target); |
|
|
|
CompareImages(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|