зеркало из https://github.com/SixLabors/Shapes.git
cleanup internal path
This commit is contained in:
Родитель
c0f5527532
Коммит
3f3912e48c
|
@ -82,7 +82,7 @@ namespace SixLabors.Shapes
|
|||
/// <param name="segment">The segment.</param>
|
||||
/// <param name="isClosedPath">if set to <c>true</c> [is closed path].</param>
|
||||
internal InternalPath(ILineSegment segment, bool isClosedPath)
|
||||
: this(segment.Flatten(), isClosedPath)
|
||||
: this(segment?.Flatten() ?? ImmutableArray<Vector2>.Empty, isClosedPath)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -105,21 +105,6 @@ namespace SixLabors.Shapes
|
|||
this.totalDistance = new Lazy<float>(this.CalculateLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InternalPath" /> class.
|
||||
/// </summary>
|
||||
/// <param name="prototype">The prototype.</param>
|
||||
/// <param name="isClosedPath">if set to <c>true</c> [is closed path].</param>
|
||||
internal InternalPath(InternalPath prototype, bool isClosedPath)
|
||||
{
|
||||
this.points = prototype.points;
|
||||
this.distance = prototype.distance;
|
||||
this.calculated = prototype.calculated;
|
||||
this.Bounds = prototype.Bounds;
|
||||
this.closedPath = isClosedPath;
|
||||
this.totalDistance = new Lazy<float>(this.CalculateLength);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the bounds.
|
||||
/// </summary>
|
||||
|
@ -210,8 +195,6 @@ namespace SixLabors.Shapes
|
|||
}
|
||||
|
||||
int position = 0;
|
||||
bool onCornerFirstPass = true;
|
||||
Side lastEdgeSide = Side.Same;
|
||||
Vector2 lastPoint = MaxVector;
|
||||
int last = -1;
|
||||
for (int i = 0; i < polyCorners && count > 0; i++)
|
||||
|
@ -231,8 +214,8 @@ namespace SixLabors.Shapes
|
|||
var side = SideOfLine(this.points[last], start, end);
|
||||
if (side != Side.Same && side == SideOfLine(this.points[next], start, end))
|
||||
{
|
||||
// same side we don't bohter adding the crossing
|
||||
position--; //move back one and the next hist will replace it
|
||||
// same side we don't bother adding the crossing
|
||||
position--; // move back one and the next hist will replace it
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче