summaryrefslogtreecommitdiff
path: root/src/interface/Label.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-03 16:58:13 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-03 16:58:13 (GMT)
commit57f949ecfbcd1baa38a90194d10a5d7266e504bd (patch)
treedceb5541c5987b176d40570c4d5d0a7ac2c8efe7 /src/interface/Label.cpp
parent40e5ce5d37cde6d923d9ca68efd0fe49e4940986 (diff)
downloadpowder-57f949ecfbcd1baa38a90194d10a5d7266e504bd.zip
powder-57f949ecfbcd1baa38a90194d10a5d7266e504bd.tar.gz
Fix text selection issue in #65
Diffstat (limited to 'src/interface/Label.cpp')
-rw-r--r--src/interface/Label.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/interface/Label.cpp b/src/interface/Label.cpp
index e388e12..8a8055e 100644
--- a/src/interface/Label.cpp
+++ b/src/interface/Label.cpp
@@ -35,6 +35,11 @@ void Label::SetMultiline(bool status)
{
updateMultiline();
updateSelection();
+ TextPosition(textLines);
+ }
+ else
+ {
+ TextPosition(text);
}
}
@@ -45,8 +50,12 @@ void Label::SetText(std::string text)
{
updateMultiline();
updateSelection();
+ TextPosition(textLines);
+ }
+ else
+ {
+ TextPosition(text);
}
- TextPosition(text);
}
void Label::updateMultiline()
@@ -68,7 +77,7 @@ void Label::updateMultiline()
if(nextSpace)
nextSpace[0] = 0;
int width = Graphics::textwidth(currentWord);
- if(width+currentWidth > Size.X-6)
+ if(width+currentWidth >= Size.X-(Appearance.Margin.Left+Appearance.Margin.Right))
{
currentWidth = width;
if(currentWord!=rawText)