Skip to content

Commit

Permalink
tweak(Studio): Drop main-thread dispatch on state-update
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Oct 30, 2024
1 parent 08bb613 commit 6220e22
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Studio/CelesteStudio/Editing/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,18 +369,16 @@ public Editor(Document document, Scrollable scrollable) {
return;
}

Application.Instance.InvokeAsync(() => {
if (Settings.Instance.SyncCaretWithPlayback && state.CurrentLine != -1) {
Document.Caret.Row = state.CurrentLine;
Document.Caret.Col = desiredVisualCol = ActionLine.MaxFramesDigits;
Document.Caret = ClampCaret(Document.Caret);
Document.Selection.Clear();
if (Settings.Instance.SyncCaretWithPlayback && state.CurrentLine != -1) {
Document.Caret.Row = state.CurrentLine;
Document.Caret.Col = desiredVisualCol = ActionLine.MaxFramesDigits;
Document.Caret = ClampCaret(Document.Caret);
Document.Selection.Clear();

ScrollCaretIntoView(center: true);
}
ScrollCaretIntoView(center: true);
}

Invalidate();
});
Invalidate();
};

// Commands
Expand Down

0 comments on commit 6220e22

Please sign in to comment.