Fix text selection issue in #65

This commit is contained in:
Simon Robertshaw 2012-08-03 17:58:13 +01:00
parent 40e5ce5d37
commit 57f949ecfb

View File

@ -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)