Extract method for scheduler call

This commit is contained in:
Marvin Schürz 2024-10-11 11:38:32 +02:00
parent 88fa6f6bc6
commit 96769897bf
1 changed files with 6 additions and 4 deletions

View File

@ -118,13 +118,15 @@ protected override void LoadComplete()
changeHandler?.BeginChange(); changeHandler?.BeginChange();
began = true; began = true;
distanceSnapInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); distanceSnapInput.Current.BindValueChanged(_ => scheduleRefresh());
offsetAngleInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); offsetAngleInput.Current.BindValueChanged(_ => scheduleRefresh());
repeatCountInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); repeatCountInput.Current.BindValueChanged(_ => scheduleRefresh());
pointInput.Current.BindValueChanged(_ => Scheduler.AddOnce(tryCreatePolygon)); pointInput.Current.BindValueChanged(_ => scheduleRefresh());
tryCreatePolygon(); tryCreatePolygon();
} }
private void scheduleRefresh() => Scheduler.AddOnce(tryCreatePolygon);
private void tryCreatePolygon() private void tryCreatePolygon()
{ {
double startTime = beatSnapProvider.SnapTime(editorClock.CurrentTime); double startTime = beatSnapProvider.SnapTime(editorClock.CurrentTime);