Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 94ec1c4

Browse files
committed
Update line numbers on panel resize
1 parent 7a400e7 commit 94ec1c4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/UI/CSConsole/ConsoleController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public static void Init()
8080
Panel.OnAutoIndentToggled += OnToggleAutoIndent;
8181
Panel.OnCtrlRToggled += OnToggleCtrlRShortcut;
8282
Panel.OnSuggestionsToggled += OnToggleSuggestions;
83+
Panel.OnPanelResized += OnInputScrolled;
8384

8485
// Run startup script
8586
try

src/UI/Panels/CSConsolePanel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class CSConsolePanel : UIPanel
3535
public Action<bool> OnCtrlRToggled;
3636
public Action<bool> OnSuggestionsToggled;
3737
public Action<bool> OnAutoIndentToggled;
38+
public Action OnPanelResized;
3839

3940
private void InvokeOnValueChanged(string value)
4041
{
@@ -62,6 +63,11 @@ public override void DoSaveToConfigElement()
6263

6364
// UI Construction
6465

66+
public override void OnFinishResize(RectTransform panel)
67+
{
68+
OnPanelResized?.Invoke();
69+
}
70+
6571
protected internal override void DoSetDefaultPosAndAnchors()
6672
{
6773
Rect.localPosition = Vector2.zero;

0 commit comments

Comments
 (0)