Add test for gradient patterns
|
@ -146,5 +146,26 @@
|
|||
<EmbeddedResource Include="ReferenceImages\ArcPathConnection.png">
|
||||
<LogicalName>ArcPathConnection.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradient.png">
|
||||
<LogicalName>LinearGradient.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradientDiagonal.png">
|
||||
<LogicalName>LinearGradientDiagonal.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradientInternalBox.png">
|
||||
<LogicalName>LinearGradientInternalBox.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradientReverse.png">
|
||||
<LogicalName>LinearGradientReverse.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\RadialGradient.png">
|
||||
<LogicalName>RadialGradient.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\RadialGradientReverse.png">
|
||||
<LogicalName>RadialGradientReverse.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\RadialGradientSmall.png">
|
||||
<LogicalName>RadialGradientSmall.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -372,6 +372,104 @@ namespace Xwt
|
|||
context.Stroke ();
|
||||
CheckImage ("NewPath.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LinearGradient ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new LinearGradient (5, 5, 5, 45);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("LinearGradient.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LinearGradientDiagonal ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new LinearGradient (5, 5, 45, 45);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("LinearGradientDiagonal.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LinearGradientReverse ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new LinearGradient (5, 45, 5, 5);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("LinearGradientReverse.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LinearGradientInternalBox ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new LinearGradient (25, 15, 35, 35);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("LinearGradientInternalBox.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RadialGradient ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new RadialGradient (20, 20, 5, 30, 30, 30);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("RadialGradient.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RadialGradientReverse ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new RadialGradient (20, 20, 30, 30, 25, 5);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("RadialGradientReverse.png");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RadialGradientSmall ()
|
||||
{
|
||||
InitBlank ();
|
||||
var g = new RadialGradient (5, 5, 5, 30, 30, 15);
|
||||
g.AddColorStop (0, Colors.Red);
|
||||
g.AddColorStop (0.5, Colors.Green);
|
||||
g.AddColorStop (1, Colors.Blue);
|
||||
context.Rectangle (5, 5, 40, 40);
|
||||
context.Pattern = g;
|
||||
context.Fill ();
|
||||
CheckImage ("RadialGradientSmall.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
После Ширина: | Высота: | Размер: 249 B |
После Ширина: | Высота: | Размер: 372 B |
После Ширина: | Высота: | Размер: 397 B |
После Ширина: | Высота: | Размер: 254 B |
После Ширина: | Высота: | Размер: 2.0 KiB |
После Ширина: | Высота: | Размер: 2.0 KiB |
После Ширина: | Высота: | Размер: 968 B |
|
@ -68,6 +68,7 @@
|
|||
<ItemGroup>
|
||||
<None Include="Test.csproj" />
|
||||
<None Include="Tests.csproj" />
|
||||
<None Include="ReferenceImages\LinearGradientInternalBox.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Xwt\Xwt.csproj">
|
||||
|
@ -157,6 +158,24 @@
|
|||
<EmbeddedResource Include="ReferenceImages\ArcPathConnection.png">
|
||||
<LogicalName>ArcPathConnection.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradient.png">
|
||||
<LogicalName>LinearGradient.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradientDiagonal.png">
|
||||
<LogicalName>LinearGradientDiagonal.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\LinearGradientReverse.png">
|
||||
<LogicalName>LinearGradientReverse.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\RadialGradient.png">
|
||||
<LogicalName>RadialGradient.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\RadialGradientReverse.png">
|
||||
<LogicalName>RadialGradientReverse.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ReferenceImages\RadialGradientSmall.png">
|
||||
<LogicalName>RadialGradientSmall.png</LogicalName>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
|
|