summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/gui_label.pas9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/gui_label.pas b/src/gui/gui_label.pas
index 76ffc036..93f5da46 100644
--- a/src/gui/gui_label.pas
+++ b/src/gui/gui_label.pas
@@ -139,10 +139,11 @@ begin
AText := UTF8Copy(AText, Succ(UTF8Pos(' ', AText)), UTF8Length(AText) - Pred(UTF8Pos(' ', AText)));
end;
until UTF8Pos(' ', AText) = 0;
- if (Font.TextWidth(FWrappedText[Pred(FWrappedText.Count)] + ' ' + AText)) < MaxLength then
- FWrappedText[Pred(FWrappedText.Count)] := FWrappedText[Pred(FWrappedText.Count)] + ' ' + AText
- else
- FWrappedText.Add(AText);
+ if FWrappedText.Count > 1 then
+ if (Font.TextWidth(FWrappedText[Pred(FWrappedText.Count)] + ' ' + AText)) < MaxLength then
+ FWrappedText[Pred(FWrappedText.Count)] := FWrappedText[Pred(FWrappedText.Count)] + ' ' + AText
+ else
+ FWrappedText.Add(AText);
Height := FWrappedText.Count * (Font.Height + 2);
end;