csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.9 KiB
79 lines
1.9 KiB
using System.Threading.Tasks;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls.Shapes;
|
|
using Avalonia.Media;
|
|
using Xunit;
|
|
|
|
namespace Avalonia.Skia.RenderTests
|
|
{
|
|
public class EllipseTests : TestBase
|
|
{
|
|
public EllipseTests()
|
|
: base(@"Shapes\Ellipse")
|
|
{
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Circle_1px_Stroke()
|
|
{
|
|
Decorator target = new Decorator
|
|
{
|
|
Padding = new Thickness(8),
|
|
Width = 200,
|
|
Height = 200,
|
|
Child = new Ellipse
|
|
{
|
|
Stroke = Brushes.Black,
|
|
StrokeThickness = 1,
|
|
}
|
|
};
|
|
|
|
await RenderToFile(target);
|
|
CompareImages();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Should_Render_Circle_Aliased()
|
|
{
|
|
var target = new Border
|
|
{
|
|
Background = Brushes.White,
|
|
Padding = new Thickness(8),
|
|
Width = 200,
|
|
Height = 200,
|
|
Child = new Ellipse
|
|
{
|
|
Stroke = Brushes.Black,
|
|
StrokeThickness = 3.5,
|
|
}
|
|
};
|
|
|
|
RenderOptions.SetEdgeMode(target, EdgeMode.Aliased);
|
|
|
|
await RenderToFile(target);
|
|
CompareImages();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Should_Render_Circle_Antialiased()
|
|
{
|
|
var target = new Border
|
|
{
|
|
Background = Brushes.White,
|
|
Padding = new Thickness(8),
|
|
Width = 200,
|
|
Height = 200,
|
|
Child = new Ellipse
|
|
{
|
|
Stroke = Brushes.Black,
|
|
StrokeThickness = 3.5,
|
|
}
|
|
};
|
|
|
|
RenderOptions.SetEdgeMode(target, EdgeMode.Antialias);
|
|
|
|
await RenderToFile(target);
|
|
CompareImages();
|
|
}
|
|
}
|
|
}
|
|
|