Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions osu.Framework/Graphics/Lines/Path_DrawNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ private void updateVertexBuffer()
Line? segmentToDraw = null;
SegmentStartLocation location = SegmentStartLocation.Outside;
SegmentStartLocation modifiedLocation = SegmentStartLocation.Outside;
SegmentStartLocation nextLocation = SegmentStartLocation.End;
SegmentWithThickness? lastDrawnSegment = null;

for (int i = 0; i < segments.Count; i++)
Expand All @@ -286,18 +287,24 @@ private void updateVertexBuffer()
Vector2 closest = segmentToDraw.Value.At(progress);

// Expand segment if next end point is located within a line passing through it
if (Precision.AlmostEquals(closest, segments[i].EndPoint, 0.1f))
if (Precision.AlmostEquals(closest, segments[i].EndPoint, 0.01f))
{
if (progress < 0)
{
// expand segment backwards
segmentToDraw = new Line(segments[i].EndPoint, segmentToDraw.Value.EndPoint);
modifiedLocation = SegmentStartLocation.Outside;
nextLocation = SegmentStartLocation.Start;
}
else if (progress > 1)
{
// or forward
segmentToDraw = new Line(segmentToDraw.Value.StartPoint, segments[i].EndPoint);
nextLocation = SegmentStartLocation.End;
}
else
{
nextLocation = SegmentStartLocation.Middle;
}
}
else // Otherwise draw the expanded segment
Expand All @@ -307,11 +314,9 @@ private void updateVertexBuffer()
connect(s, lastDrawnSegment, texRect);

lastDrawnSegment = s;

// Figure out at which point within currently drawn segment the new one starts
float p = progressFor(segmentToDraw.Value, segmentToDrawLength, segments[i].StartPoint);
segmentToDraw = segments[i];
location = modifiedLocation = Precision.AlmostEquals(p, 1f) ? SegmentStartLocation.End : Precision.AlmostEquals(p, 0f) ? SegmentStartLocation.Start : SegmentStartLocation.Middle;
location = modifiedLocation = nextLocation;
nextLocation = SegmentStartLocation.End;
}
}
else
Expand Down
Loading