Browse Source

update external dependencies + fix RectangularPolygon usages

af/merge-core
Anton Firszov 8 years ago
parent
commit
29d6291fd6
  1. 6
      src/ImageSharp.Drawing/ImageSharp.Drawing.csproj
  2. 2
      src/ImageSharp.Drawing/Processing/Drawing/DrawRectangleExtensions.cs
  3. 4
      src/ImageSharp.Drawing/Processing/Drawing/FillRectangleExtensions.cs
  4. 2
      src/ImageSharp/ImageSharp.csproj
  5. 8
      tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs
  6. 2
      tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs

6
src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

@ -36,9 +36,9 @@
<ProjectReference Include="..\ImageSharp\ImageSharp.csproj" /> <ProjectReference Include="..\ImageSharp\ImageSharp.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SixLabors.Core" Version="1.0.0-ci0005" /> <PackageReference Include="SixLabors.Core" Version="1.0.0-beta0005" />
<PackageReference Include="SixLabors.Shapes.Text" Version="1.0.0-ci0005" /> <PackageReference Include="SixLabors.Shapes" Version="1.0.0-beta0004" />
<PackageReference Include="SixLabors.Shapes" Version="1.0.0-ci0005" /> <PackageReference Include="SixLabors.Shapes.Text" Version="1.0.0-beta0004" />
<AdditionalFiles Include="..\..\stylecop.json" /> <AdditionalFiles Include="..\..\stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004"> <PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
<PrivateAssets>All</PrivateAssets> <PrivateAssets>All</PrivateAssets>

2
src/ImageSharp.Drawing/Processing/Drawing/DrawRectangleExtensions.cs

@ -25,7 +25,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing
/// <returns>The <see cref="Image{TPixel}"/>.</returns> /// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options, IPen<TPixel> pen, RectangleF shape) public static IImageProcessingContext<TPixel> Draw<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options, IPen<TPixel> pen, RectangleF shape)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
=> source.Draw(options, pen, new RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height)); => source.Draw(options, pen, new RectangularPolygon(shape.X, shape.Y, shape.Width, shape.Height));
/// <summary> /// <summary>
/// Draws the outline of the rectangle with the provided pen. /// Draws the outline of the rectangle with the provided pen.

4
src/ImageSharp.Drawing/Processing/Drawing/FillRectangleExtensions.cs

@ -24,7 +24,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing
/// <returns>The <see cref="Image{TPixel}"/>.</returns> /// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options, IBrush<TPixel> brush, RectangleF shape) public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, GraphicsOptions options, IBrush<TPixel> brush, RectangleF shape)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
=> source.Fill(options, brush, new RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height)); => source.Fill(options, brush, new RectangularPolygon(shape.X, shape.Y, shape.Width, shape.Height));
/// <summary> /// <summary>
/// Flood fills the image in the shape of the provided rectangle with the specified brush. /// Flood fills the image in the shape of the provided rectangle with the specified brush.
@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing
/// <returns>The <see cref="Image{TPixel}"/>.</returns> /// <returns>The <see cref="Image{TPixel}"/>.</returns>
public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, RectangleF shape) public static IImageProcessingContext<TPixel> Fill<TPixel>(this IImageProcessingContext<TPixel> source, IBrush<TPixel> brush, RectangleF shape)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
=> source.Fill(brush, new RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height)); => source.Fill(brush, new RectangularPolygon(shape.X, shape.Y, shape.Width, shape.Height));
/// <summary> /// <summary>
/// Flood fills the image in the shape of the provided rectangle with the specified brush. /// Flood fills the image in the shape of the provided rectangle with the specified brush.

2
src/ImageSharp/ImageSharp.csproj

@ -35,7 +35,7 @@
<Compile Include="..\Shared\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" /> <Compile Include="..\Shared\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SixLabors.Core" Version="1.0.0-ci0005" /> <PackageReference Include="SixLabors.Core" Version="1.0.0-beta0005" />
<AdditionalFiles Include="..\..\stylecop.json" /> <AdditionalFiles Include="..\..\stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta006"> <PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta006">
<PrivateAssets>All</PrivateAssets> <PrivateAssets>All</PrivateAssets>

8
tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs

@ -26,7 +26,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths
Assert.Equal(GraphicsOptions.Default, processor.Options); Assert.Equal(GraphicsOptions.Default, processor.Options);
ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region); ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region);
Shapes.RectangularePolygon rect = Assert.IsType<Shapes.RectangularePolygon>(region.Shape); Shapes.RectangularPolygon rect = Assert.IsType<Shapes.RectangularPolygon>(region.Shape);
Assert.Equal(rect.Location.X, this.rectangle.X); Assert.Equal(rect.Location.X, this.rectangle.X);
Assert.Equal(rect.Location.Y, this.rectangle.Y); Assert.Equal(rect.Location.Y, this.rectangle.Y);
Assert.Equal(rect.Size.Width, this.rectangle.Width); Assert.Equal(rect.Size.Width, this.rectangle.Width);
@ -44,7 +44,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths
Assert.Equal(this.noneDefault, processor.Options); Assert.Equal(this.noneDefault, processor.Options);
ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region); ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region);
Shapes.RectangularePolygon rect = Assert.IsType<Shapes.RectangularePolygon>(region.Shape); Shapes.RectangularPolygon rect = Assert.IsType<Shapes.RectangularPolygon>(region.Shape);
Assert.Equal(rect.Location.X, this.rectangle.X); Assert.Equal(rect.Location.X, this.rectangle.X);
Assert.Equal(rect.Location.Y, this.rectangle.Y); Assert.Equal(rect.Location.Y, this.rectangle.Y);
Assert.Equal(rect.Size.Width, this.rectangle.Width); Assert.Equal(rect.Size.Width, this.rectangle.Width);
@ -62,7 +62,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths
Assert.Equal(GraphicsOptions.Default, processor.Options); Assert.Equal(GraphicsOptions.Default, processor.Options);
ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region); ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region);
Shapes.RectangularePolygon rect = Assert.IsType<Shapes.RectangularePolygon>(region.Shape); Shapes.RectangularPolygon rect = Assert.IsType<Shapes.RectangularPolygon>(region.Shape);
Assert.Equal(rect.Location.X, this.rectangle.X); Assert.Equal(rect.Location.X, this.rectangle.X);
Assert.Equal(rect.Location.Y, this.rectangle.Y); Assert.Equal(rect.Location.Y, this.rectangle.Y);
Assert.Equal(rect.Size.Width, this.rectangle.Width); Assert.Equal(rect.Size.Width, this.rectangle.Width);
@ -81,7 +81,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing.Paths
Assert.Equal(this.noneDefault, processor.Options); Assert.Equal(this.noneDefault, processor.Options);
ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region); ShapeRegion region = Assert.IsType<ShapeRegion>(processor.Region);
Shapes.RectangularePolygon rect = Assert.IsType<Shapes.RectangularePolygon>(region.Shape); Shapes.RectangularPolygon rect = Assert.IsType<Shapes.RectangularPolygon>(region.Shape);
Assert.Equal(rect.Location.X, this.rectangle.X); Assert.Equal(rect.Location.X, this.rectangle.X);
Assert.Equal(rect.Location.Y, this.rectangle.Y); Assert.Equal(rect.Location.Y, this.rectangle.Y);
Assert.Equal(rect.Size.Width, this.rectangle.Width); Assert.Equal(rect.Size.Width, this.rectangle.Width);

2
tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs

@ -151,7 +151,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing
{ {
image.Mutate(x => x image.Mutate(x => x
.BackgroundColor(Rgba32.Blue) .BackgroundColor(Rgba32.Blue)
.Fill(Rgba32.HotPink, new SixLabors.Shapes.RectangularePolygon(10, 10, 190, 140))); .Fill(Rgba32.HotPink, new SixLabors.Shapes.RectangularPolygon(10, 10, 190, 140)));
image.Save($"{path}/Rectangle.png"); image.Save($"{path}/Rectangle.png");
using (PixelAccessor<Rgba32> sourcePixels = image.Lock()) using (PixelAccessor<Rgba32> sourcePixels = image.Lock())

Loading…
Cancel
Save