Browse Source

tests fixed

pull/1535/head
Benedikt Schroeder 9 years ago
parent
commit
d5ace4db8d
  1. 8
      src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs
  2. 16
      tests/Avalonia.RenderTests/Controls/BorderTests.cs
  3. 2
      tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

8
src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs

@ -51,12 +51,8 @@ namespace Avalonia.Direct2D1.Media
(float)typeface.FontSize); (float)typeface.FontSize);
} }
textFormat.TextAlignment = DWrite.TextAlignment.Center; textFormat.WordWrapping =
textFormat.ParagraphAlignment = DWrite.ParagraphAlignment.Center; wrapping == TextWrapping.Wrap ? DWrite.WordWrapping.Wrap : DWrite.WordWrapping.NoWrap;
textFormat.WordWrapping = wrapping == TextWrapping.Wrap ?
DWrite.WordWrapping.Wrap :
DWrite.WordWrapping.NoWrap;
TextLayout = new DWrite.TextLayout(factory, Text ?? string.Empty, textFormat, (float)constraint.Width, TextLayout = new DWrite.TextLayout(factory, Text ?? string.Empty, textFormat, (float)constraint.Width,
(float)constraint.Height) (float)constraint.Height)

16
tests/Avalonia.RenderTests/Controls/BorderTests.cs

@ -204,7 +204,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center,
} }
@ -231,7 +231,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
VerticalAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center,
} }
@ -258,7 +258,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch,
} }
@ -285,7 +285,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
VerticalAlignment = VerticalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch,
} }
@ -312,7 +312,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
} }
@ -339,7 +339,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Right, HorizontalAlignment = HorizontalAlignment.Right,
} }
@ -366,7 +366,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
VerticalAlignment = VerticalAlignment.Top, VerticalAlignment = VerticalAlignment.Top,
} }
@ -393,7 +393,7 @@ namespace Avalonia.Direct2D1.RenderTests.Controls
{ {
Text = "Foo", Text = "Foo",
Background = Brushes.Red, Background = Brushes.Red,
FontFamily = "Segoe UI", FontFamily = new FontFamily("Segoe UI"),
FontSize = 12, FontSize = 12,
VerticalAlignment = VerticalAlignment.Bottom, VerticalAlignment = VerticalAlignment.Bottom,
} }

2
tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

@ -48,7 +48,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media
Child = new TextBlock Child = new TextBlock
{ {
FontSize = 24, FontSize = 24,
FontFamily = "Arial", FontFamily = new FontFamily("Arial"),
Background = Brushes.Green, Background = Brushes.Green,
Foreground = Brushes.Yellow, Foreground = Brushes.Yellow,
Text = "VisualBrush", Text = "VisualBrush",

Loading…
Cancel
Save