Merging dev into main #19

Merged
JacobTech merged 5 commits from dev into main 2024-04-14 14:44:25 -04:00
1 changed files with 8 additions and 1 deletions
Showing only changes of commit 47469e0f1a - Show all commits

View File

@ -236,6 +236,13 @@ public class TextBox : UserControl
_label.Location = _label.Location;
}
}
if (_label.Text.Length < CursorLocation)
{
CursorLocation = _label.Text.Length;
var xy = _label.GetCharLocation(CursorLocation);
Pointer.Location = new(_label.Location.X + xy.X, _label.Location.Y + xy.Y, Pointer.Location.Z);
}
}
}
public string WatermarkText
@ -283,8 +290,8 @@ public class TextBox : UserControl
Size = new(Size.X, Size.Y - (int)_label.Font.PixelHeight);
if (OnRemoveLine is not null) OnRemoveLine.Invoke();
}
Text = Text.Remove(CursorLocation - 1, 1);
CursorLocation--;
Text = Text.Remove(CursorLocation, 1);
var f = _label.GetCharLocation(CursorLocation);
Pointer.Location = _label.Location + new Vector3i(f.X, f.Y, 0);
Pointer.Visible = true;