Browse Source

tests fixed

Benedikt Schroeder 7 years ago
parent
commit
d5ace4db8d

+ 2 - 6
src/Windows/Avalonia.Direct2D1/Media/FormattedTextImpl.cs

@@ -51,12 +51,8 @@ namespace Avalonia.Direct2D1.Media
                     (float)typeface.FontSize);
             }
 
-            textFormat.TextAlignment = DWrite.TextAlignment.Center;
-            textFormat.ParagraphAlignment = DWrite.ParagraphAlignment.Center;
-
-            textFormat.WordWrapping = 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,
                 (float)constraint.Height)

+ 8 - 8
tests/Avalonia.RenderTests/Controls/BorderTests.cs

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

+ 1 - 1
tests/Avalonia.RenderTests/Media/VisualBrushTests.cs

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