This commit is contained in:
James Jackson-South 2019-09-01 19:51:53 +10:00
Родитель f24222e550
Коммит 374ed299c5
4 изменённых файлов: 31 добавлений и 22 удалений

@ -1 +1 @@
Subproject commit 9b5a5b70b46bc23b9d8d8645cd691d5bc5a2d84f Subproject commit faf84e44ec90e8a42a7271bcd04fea76279efb08

Просмотреть файл

@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System; using System;
@ -163,7 +163,7 @@ namespace SixLabors.Shapes
return new PointInfo return new PointInfo
{ {
DistanceAlongPath = this.points[closestPoint].TotalLength + Vector2.Distance(this.points[closestPoint].Point, internalInfo.PointOnLine), DistanceAlongPath = this.points[closestPoint].TotalLength + Vector2.Distance(this.points[closestPoint].Point, internalInfo.PointOnLine),
DistanceFromPath = (float)Math.Sqrt(internalInfo.DistanceSquared), DistanceFromPath = MathF.Sqrt(internalInfo.DistanceSquared),
SearchPoint = point, SearchPoint = point,
ClosestPointOnPath = internalInfo.PointOnLine ClosestPointOnPath = internalInfo.PointOnLine
}; };
@ -617,13 +617,13 @@ namespace SixLabors.Shapes
// all points are common, shouldn't match anything // all points are common, shouldn't match anything
results.Add( results.Add(
new PointData new PointData
{ {
Point = points[0], Point = points[0],
Orientation = Orientation.Colinear, Orientation = Orientation.Colinear,
Segment = new Segment(points[0], points[1]), Segment = new Segment(points[0], points[1]),
Length = 0, Length = 0,
TotalLength = 0 TotalLength = 0
}); });
return results.ToArray(); return results.ToArray();
} }
} }
@ -634,12 +634,12 @@ namespace SixLabors.Shapes
results.Add( results.Add(
new PointData new PointData
{ {
Point = points[0], Point = points[0],
Orientation = CalulateOrientation(lastPoint, points[0], points[1]), Orientation = CalulateOrientation(lastPoint, points[0], points[1]),
Length = Vector2.Distance(lastPoint, points[0]), Length = Vector2.Distance(lastPoint, points[0]),
TotalLength = 0 TotalLength = 0
}); });
lastPoint = points[0]; lastPoint = points[0];
} }

Просмотреть файл

@ -1,4 +1,4 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System; using System;
@ -301,7 +301,7 @@ namespace SixLabors.Shapes
return new SegmentInfo return new SegmentInfo
{ {
Point = new Vector2(this.Left + distanceAlongPath, this.Top), Point = new Vector2(this.Left + distanceAlongPath, this.Top),
Angle = (float)Math.PI Angle = MathF.PI
}; };
} }
else else
@ -313,7 +313,7 @@ namespace SixLabors.Shapes
return new SegmentInfo return new SegmentInfo
{ {
Point = new Vector2(this.Right, this.Top + distanceAlongPath), Point = new Vector2(this.Right, this.Top + distanceAlongPath),
Angle = -(float)Math.PI / 2 Angle = -MathF.PI / 2
}; };
} }
else else
@ -499,4 +499,4 @@ namespace SixLabors.Shapes
return hashCode; return hashCode;
} }
} }
} }

Просмотреть файл

@ -31,6 +31,15 @@
<Compile Include="..\Shared\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" /> <Compile Include="..\Shared\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
</ItemGroup> </ItemGroup>
<!-- TODO: Include .NETSTANDARD2.1 when released-->
<PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp2')) ">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp2.1')) ">
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\shared-infrastructure\**\*.cs" /> <Compile Include="..\..\shared-infrastructure\**\*.cs" />
</ItemGroup> </ItemGroup>
@ -42,9 +51,9 @@
<ItemGroup> <ItemGroup>
<AdditionalFiles Include="..\..\shared-infrastructure\stylecop.json" /> <AdditionalFiles Include="..\..\shared-infrastructure\stylecop.json" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" /> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SixLabors.Core" Version="1.0.0-dev000137" /> <PackageReference Include="SixLabors.Core" Version="1.0.0-dev000141" />
</ItemGroup> </ItemGroup>
</Project> </Project>