Fixed infinite loop issue with search box when textbox content shrinks

This commit is contained in:
Souryo 2015-08-06 23:04:55 -04:00
parent 5c4089c013
commit 83d91d02c0

View file

@ -270,7 +270,7 @@ namespace Mesen.GUI.Debugger
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int CursorPosition
{
get { return _cursorPosition; }
get { return Math.Min(this._contents.Length - 1, Math.Max(0, _cursorPosition)); }
set
{
_cursorPosition = Math.Min(this._contents.Length - 1, Math.Max(0, value));