Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes/skia dash array #18001

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions tests/Avalonia.RenderTests/Shapes/LineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,33 @@ public async Task Line_1px_Stroke_Vertical()
await RenderToFile(target);
CompareImages();
}

[Fact]
public async Task Lines_With_DashArray()
{
var stackPanel = new StackPanel();

stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [1] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [1, 1] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [1, 6] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [6, 1] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [0.25, 1] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [4, 1, 1, 1, 1, 1] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [5, 5, 1, 5] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [1, 2, 4] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [4, 2, 4] });
stackPanel.Children.Add(new Line() { Margin = new Thickness(8), StrokeThickness = 8, StartPoint = new Point(0, 0), EndPoint = new Point(200, 0), Stroke = Brushes.Black, StrokeDashArray = [4, 2, 4, 1, 1] });


Decorator target = new Decorator
{
Width = 200,
Height = 200,
Child = stackPanel
};

await RenderToFile(target);
CompareImages();
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading