Skip to content

Commit

Permalink
fix another hold rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasu3D authored and Raymonf committed Feb 12, 2024
1 parent 562fc9d commit d92e673
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions BAKKA_Editor/Rendering/RenderEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,14 @@ private void DrawHolds(Chart chart, bool highlightSelectedNote, int selectedNote

var currentStartAngle = currentInfo.StartAngle;
var previousStartAngle = previousInfo.StartAngle;
var previousArcAngle = previousInfo.ArcAngle;

// crop off-screen arc
if (note.PrevReferencedNote.Size != 60)
{
previousStartAngle += 1.5f;
previousArcAngle -= 3.0f;
}

// handle angles rolling over
if (Math.Abs(currentStartAngle - previousStartAngle) > 180)
Expand All @@ -636,7 +644,7 @@ private void DrawHolds(Chart chart, bool highlightSelectedNote, int selectedNote

// calculate new startAngle and arcAngle for intermediate arc
var currentEndAngle = currentStartAngle - currentInfo.ArcAngle;
var newEndAngle = scaleRatio * (previousStartAngle - previousInfo.ArcAngle - (currentEndAngle)) +
var newEndAngle = scaleRatio * (previousStartAngle - previousArcAngle - (currentEndAngle)) +
(currentEndAngle);

var newStartAngle = scaleRatio * (previousStartAngle - currentStartAngle) + currentStartAngle;
Expand All @@ -648,17 +656,12 @@ private void DrawHolds(Chart chart, bool highlightSelectedNote, int selectedNote
var arc2StartAngle = newStartAngle + newArcLength;
var arc2ArcLength = -newArcLength;

// crop arcs
// crop visible arc
if (note.Size != 60)
{
arc1StartAngle += 1.5f;
arc1ArcLength -= 3.0f;
}
if (note.PrevReferencedNote.Size != 60)
{
arc2StartAngle -= 1.5f;
arc2ArcLength += 3.0f;
}

var path = new SKPath();
path.ArcTo(currentInfo.Rect, arc1StartAngle, arc1ArcLength, true);
Expand Down

0 comments on commit d92e673

Please sign in to comment.