Remove bounds check for text selection, makes text selection a little easier for users
This commit is contained in:
parent
dceefed030
commit
7ef3f8cbe9
@ -102,8 +102,6 @@ std::string Label::GetText()
|
|||||||
|
|
||||||
void Label::OnMouseClick(int x, int y, unsigned button)
|
void Label::OnMouseClick(int x, int y, unsigned button)
|
||||||
{
|
{
|
||||||
if(x > textPosition.X && x < textPosition.X + textSize.X && y > textPosition.Y && y < textPosition.Y + textSize.Y)
|
|
||||||
{
|
|
||||||
selecting = true;
|
selecting = true;
|
||||||
if(multiline)
|
if(multiline)
|
||||||
selectionIndex0 = Graphics::CharIndexAtPosition((char*)textLines.c_str(), x-textPosition.X, y-textPosition.Y);
|
selectionIndex0 = Graphics::CharIndexAtPosition((char*)textLines.c_str(), x-textPosition.X, y-textPosition.Y);
|
||||||
@ -112,7 +110,6 @@ void Label::OnMouseClick(int x, int y, unsigned button)
|
|||||||
selectionIndex1 = selectionIndex0;
|
selectionIndex1 = selectionIndex0;
|
||||||
|
|
||||||
updateSelection();
|
updateSelection();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Label::OnMouseUp(int x, int y, unsigned button)
|
void Label::OnMouseUp(int x, int y, unsigned button)
|
||||||
|
Loading…
Reference in New Issue
Block a user