Skip to content

Commit

Permalink
Fixed note scaling to use time instead of measures
Browse files Browse the repository at this point in the history
  • Loading branch information
Goatgarien committed Feb 15, 2023
1 parent 89db842 commit 85d3f63
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion BAKKA-Editor/CircleView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,21 @@ private float GetTotalMeasureShowNotes(Chart chart)
return EndMeasure.MeasureDecimal - CurrentMeasure;
}

private float GetNoteScaleFromMeasure(Chart chart, float objectTime)
{
// Scale from 0-1
float objectTimeAsTime = chart.GetTime(new BeatInfo(objectTime));
float currentTime = chart.GetTime(new BeatInfo(CurrentMeasure));
float totalTimeDisplayed = chart.GetTime(new BeatInfo(CurrentMeasure + GetTotalMeasureShowNotes(chart))) - currentTime;
float notescaleInit = 1 - ((objectTimeAsTime - currentTime) * (1 / totalTimeDisplayed));
return notescaleInit;
}

private ArcInfo GetScaledRect(Chart chart, float objectTime)
{
ArcInfo info = new();
float notescaleInit = 1 - ((objectTime - CurrentMeasure) * (1 / GetTotalMeasureShowNotes(chart))); // Scale from 0-1

float notescaleInit = GetNoteScaleFromMeasure(chart, objectTime);
info.NoteScale = (float)Math.Pow(10.0f, notescaleInit) / 10.0f;
float scaledRectSize = DrawRect.Width * info.NoteScale;
float scaledRadius = scaledRectSize / 2.0f;
Expand Down

0 comments on commit 85d3f63

Please sign in to comment.