mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 02:40:47 +02:00
Fix text selection issue in #65
This commit is contained in:
@@ -35,6 +35,11 @@ void Label::SetMultiline(bool status)
|
|||||||
{
|
{
|
||||||
updateMultiline();
|
updateMultiline();
|
||||||
updateSelection();
|
updateSelection();
|
||||||
|
TextPosition(textLines);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TextPosition(text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +50,12 @@ void Label::SetText(std::string text)
|
|||||||
{
|
{
|
||||||
updateMultiline();
|
updateMultiline();
|
||||||
updateSelection();
|
updateSelection();
|
||||||
|
TextPosition(textLines);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TextPosition(text);
|
TextPosition(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Label::updateMultiline()
|
void Label::updateMultiline()
|
||||||
@@ -68,7 +77,7 @@ void Label::updateMultiline()
|
|||||||
if(nextSpace)
|
if(nextSpace)
|
||||||
nextSpace[0] = 0;
|
nextSpace[0] = 0;
|
||||||
int width = Graphics::textwidth(currentWord);
|
int width = Graphics::textwidth(currentWord);
|
||||||
if(width+currentWidth > Size.X-6)
|
if(width+currentWidth >= Size.X-(Appearance.Margin.Left+Appearance.Margin.Right))
|
||||||
{
|
{
|
||||||
currentWidth = width;
|
currentWidth = width;
|
||||||
if(currentWord!=rawText)
|
if(currentWord!=rawText)
|
||||||
|
Reference in New Issue
Block a user