diff --git a/shared-infrastructure b/shared-infrastructure index 9b5a5b7..faf84e4 160000 --- a/shared-infrastructure +++ b/shared-infrastructure @@ -1 +1 @@ -Subproject commit 9b5a5b70b46bc23b9d8d8645cd691d5bc5a2d84f +Subproject commit faf84e44ec90e8a42a7271bcd04fea76279efb08 diff --git a/src/SixLabors.Shapes/InternalPath.cs b/src/SixLabors.Shapes/InternalPath.cs index cf5e6d7..7641e93 100644 --- a/src/SixLabors.Shapes/InternalPath.cs +++ b/src/SixLabors.Shapes/InternalPath.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -163,7 +163,7 @@ namespace SixLabors.Shapes return new PointInfo { 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, ClosestPointOnPath = internalInfo.PointOnLine }; @@ -617,13 +617,13 @@ namespace SixLabors.Shapes // all points are common, shouldn't match anything results.Add( new PointData - { - Point = points[0], - Orientation = Orientation.Colinear, - Segment = new Segment(points[0], points[1]), - Length = 0, - TotalLength = 0 - }); + { + Point = points[0], + Orientation = Orientation.Colinear, + Segment = new Segment(points[0], points[1]), + Length = 0, + TotalLength = 0 + }); return results.ToArray(); } } @@ -634,12 +634,12 @@ namespace SixLabors.Shapes results.Add( new PointData - { - Point = points[0], - Orientation = CalulateOrientation(lastPoint, points[0], points[1]), - Length = Vector2.Distance(lastPoint, points[0]), - TotalLength = 0 - }); + { + Point = points[0], + Orientation = CalulateOrientation(lastPoint, points[0], points[1]), + Length = Vector2.Distance(lastPoint, points[0]), + TotalLength = 0 + }); lastPoint = points[0]; } diff --git a/src/SixLabors.Shapes/RectangularPolygon.cs b/src/SixLabors.Shapes/RectangularPolygon.cs index c980564..7400125 100644 --- a/src/SixLabors.Shapes/RectangularPolygon.cs +++ b/src/SixLabors.Shapes/RectangularPolygon.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -301,7 +301,7 @@ namespace SixLabors.Shapes return new SegmentInfo { Point = new Vector2(this.Left + distanceAlongPath, this.Top), - Angle = (float)Math.PI + Angle = MathF.PI }; } else @@ -313,7 +313,7 @@ namespace SixLabors.Shapes return new SegmentInfo { Point = new Vector2(this.Right, this.Top + distanceAlongPath), - Angle = -(float)Math.PI / 2 + Angle = -MathF.PI / 2 }; } else @@ -499,4 +499,4 @@ namespace SixLabors.Shapes return hashCode; } } -} \ No newline at end of file +} diff --git a/src/SixLabors.Shapes/SixLabors.Shapes.csproj b/src/SixLabors.Shapes/SixLabors.Shapes.csproj index e258cb4..9fd4d85 100644 --- a/src/SixLabors.Shapes/SixLabors.Shapes.csproj +++ b/src/SixLabors.Shapes/SixLabors.Shapes.csproj @@ -31,6 +31,15 @@ + + + $(DefineConstants);SUPPORTS_MATHF + + + + $(DefineConstants);SUPPORTS_HASHCODE + + @@ -42,9 +51,9 @@ - + - + \ No newline at end of file