summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-07-24 10:57:21 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-07-24 10:57:21 +0000
commit70145feefdb546f0f1fd18cf9f3f804c8304fc01 (patch)
treeafb65b5af1d4cb6c320b3ed879fdd01a3b0e8e97 /src/corelib
parenteaf3100e8d682ac3bc28725c004e4836169d7654 (diff)
downloadfpGUI-70145feefdb546f0f1fd18cf9f3f804c8304fc01.tar.xz
* Minor fix in right aligned text. Removing remainder spaces before a linebreak.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpgfx.pas5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas
index 1d5a23cc..bbc530d7 100644
--- a/src/corelib/fpgfx.pas
+++ b/src/corelib/fpgfx.pas
@@ -1107,7 +1107,8 @@ end;
{ TfpgCanvas }
// Warning! This function is not supposed to handle existing line breaks,
-// it is only supposed to insert new ones when appropriate.
+// it is only supposed to insert new ones when appropriate. Also, this function
+// simply inserts line breaks, it doesn't split text lines etc...
function TfpgCanvas.AddLineBreaks(const s: TfpgString; aMaxLineWidth: integer): string;
var
i, n, ls: integer;
@@ -1141,7 +1142,7 @@ begin
if (lw + tw > aMaxLineWidth) and (lw > 0) then
begin
lw := tw;
- Result := Result + sLineBreak;
+ Result := TrimRight(Result) + sLineBreak;
end else
Inc(lw, tw);
Result := Result + sub;