summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-02-22 12:32:30 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-02-22 12:32:30 +0000
commiteef47629e4f3c3290754df2eefa56d870e15744f (patch)
treec1e28d69a1a48152e8197172ee38e7fc8286f9c6
parent31049921e04cf091e7d66faba92438ea15fc5a6b (diff)
downloadfpGUI-eef47629e4f3c3290754df2eefa56d870e15744f.tar.xz
* Applied minor Label patch from Jean-Marc.
-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;