summaryrefslogtreecommitdiff
path: root/src/interface/Label.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-24 16:45:31 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-24 16:45:31 (GMT)
commit7ef3f8cbe942c2f7ed47c4eea4248f21d407d71c (patch)
treedf0cf3af3ac90fae16d4ffb16598adda76fa7594 /src/interface/Label.cpp
parentdceefed030e8fb6452cf71e79904bb44a5d1acfa (diff)
downloadpowder-7ef3f8cbe942c2f7ed47c4eea4248f21d407d71c.zip
powder-7ef3f8cbe942c2f7ed47c4eea4248f21d407d71c.tar.gz
Remove bounds check for text selection, makes text selection a little easier for users
Diffstat (limited to 'src/interface/Label.cpp')
-rw-r--r--src/interface/Label.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/interface/Label.cpp b/src/interface/Label.cpp
index 76ea45f..b7283c2 100644
--- a/src/interface/Label.cpp
+++ b/src/interface/Label.cpp
@@ -102,17 +102,14 @@ std::string Label::GetText()
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;
- if(multiline)
- selectionIndex0 = Graphics::CharIndexAtPosition((char*)textLines.c_str(), x-textPosition.X, y-textPosition.Y);
- else
- selectionIndex0 = Graphics::CharIndexAtPosition((char*)text.c_str(), x-textPosition.X, y-textPosition.Y);
- selectionIndex1 = selectionIndex0;
+ selecting = true;
+ if(multiline)
+ selectionIndex0 = Graphics::CharIndexAtPosition((char*)textLines.c_str(), x-textPosition.X, y-textPosition.Y);
+ else
+ selectionIndex0 = Graphics::CharIndexAtPosition((char*)text.c_str(), x-textPosition.X, y-textPosition.Y);
+ selectionIndex1 = selectionIndex0;
- updateSelection();
- }
+ updateSelection();
}
void Label::OnMouseUp(int x, int y, unsigned button)