LazReport, fix text layout in multilined memos, patch with changes from Andrey Gusev, issue #10646

git-svn-id: trunk@13846 -
This commit is contained in:
jesus 2008-01-23 21:41:32 +00:00
parent ac48f8d690
commit 6801187bf3
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
The following people contributed to LazReport : The following people contributed to LazReport :
Aleksey Lagunov (ru) Aleksey Lagunov (ru)
Andrey Gusev (ru)
Christian Ulrich (de) Christian Ulrich (de)
German Basisty (ar) German Basisty (ar)
Javier Villarroya (es) Javier Villarroya (es)

View File

@ -2287,7 +2287,7 @@ var
begin begin
AssignFont(Canvas); AssignFont(Canvas);
Ts := Canvas.TextStyle; Ts := Canvas.TextStyle;
Ts.Layout :=Layout; Ts.Layout :=tlTop;
Ts.Alignment :=self.Alignment; Ts.Alignment :=self.Alignment;
Ts.Wordbreak :=false; Ts.Wordbreak :=false;
Ts.SingleLine:=True; Ts.SingleLine:=True;
@ -2306,7 +2306,7 @@ var
DebugLn('Rescal font ',IntToStr(Canvas.Font.Size)); DebugLn('Rescal font ',IntToStr(Canvas.Font.Size));
{$ENDIF} {$ENDIF}
end; end;
th := Canvas.TextHeight('H')+Round(LineSpacing * ScaleY); th := -Canvas.Font.Height+Round(LineSpacing * ScaleY);
{$IFDEF DebugLR} {$IFDEF DebugLR}
DebugLn('Th=',Inttostr(Th),' Canvas.TextHeight(H)=',InttoStr(Canvas.TextHeight('H'))); DebugLn('Th=',Inttostr(Th),' Canvas.TextHeight(H)=',InttoStr(Canvas.TextHeight('H')));
Debugln('2 Canvas.Font.Size=',InttoStr(Canvas.Font.Size),' TextWidth=',InttoStr(Canvas.TextWidth(St))); Debugln('2 Canvas.Font.Size=',InttoStr(Canvas.Font.Size),' TextWidth=',InttoStr(Canvas.TextWidth(St)));
@ -2364,7 +2364,7 @@ var
begin {OutMemo} begin {OutMemo}
cury := y + gapy; cury := y + gapy;
th := Canvas.TextHeight('H')+Round(LineSpacing * ScaleY); th := -Canvas.Font.Height+Round(LineSpacing * ScaleY);
{$IFDEF DebugLR} {$IFDEF DebugLR}
DebugLn('Th=',IntToStr(Th),' Canvas.TextHeight(H)=',InttoStr(Canvas.TextHeight('H')), 'DR=',dbgs(DR)); DebugLn('Th=',IntToStr(Th),' Canvas.TextHeight(H)=',InttoStr(Canvas.TextHeight('H')), 'DR=',dbgs(DR));
{$ENDIF} {$ENDIF}