Skip to content

Commit

Permalink
Fixed textfield caret stuck at beginning or end when selected all texts
Browse files Browse the repository at this point in the history
  • Loading branch information
Neko-Box-Coder committed Aug 29, 2023
1 parent 16b2057 commit 99e846b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Src/ssGUI/GUIObjectClasses/TextField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ namespace ssGUI
else if(GetEndSelectionIndex() <= GetStartSelectionIndex() && GetEndSelectionIndex() > GetFirstValidCharacterIndex())
leftMostIndex = GetEndSelectionIndex();
else
return;
leftMostIndex = 0;
}
else
leftMostIndex = GetEndSelectionIndex();
Expand Down Expand Up @@ -275,13 +275,13 @@ namespace ssGUI

if(!selectionMode)
{
if(GetStartSelectionIndex() >= GetEndSelectionIndex() && GetStartSelectionIndex() + 1 <= GetCharactersDetailsCount())
if(GetStartSelectionIndex() >= GetEndSelectionIndex() && GetStartSelectionIndex() <= GetCharactersDetailsCount())
rightMostIndex = GetStartSelectionIndex();
else if(GetEndSelectionIndex() >= GetStartSelectionIndex() && GetEndSelectionIndex() + 1 <= GetCharactersDetailsCount())
else if(GetEndSelectionIndex() >= GetStartSelectionIndex() && GetEndSelectionIndex() <= GetCharactersDetailsCount())
rightMostIndex = GetEndSelectionIndex();
else
return;
}
rightMostIndex = GetCharactersDetailsCount();
}
else
rightMostIndex = GetEndSelectionIndex();

Expand Down

0 comments on commit 99e846b

Please sign in to comment.