mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 22:29:25 +02:00
LazReport, corrects vertical alignment after tony's patches and improve precision on exporting to pdf, from Julio Jiménez Borreguero
git-svn-id: trunk@39233 -
This commit is contained in:
parent
fcf1548c45
commit
bbe4e752eb
@ -184,8 +184,8 @@ begin
|
||||
PPage.MarginLeft := 0;
|
||||
PPage.MarginRight := 0;
|
||||
|
||||
PPage.Height := round(CurReport.EMFPages[FPageNo - 1]^.PrnInfo.Pgh*PDFEscy);
|
||||
PPage.Width := round(CurReport.EMFPages[FPageNo - 1]^.PrnInfo.Pgw*PDFEscx);
|
||||
PPage.Height := trunc(CurReport.EMFPages[FPageNo - 1]^.PrnInfo.Pgh*PDFEscy + 0.5);
|
||||
PPage.Width := trunc(CurReport.EMFPages[FPageNo - 1]^.PrnInfo.Pgw*PDFEscx + 0.5);
|
||||
|
||||
PRPanel := TPRPanel.Create(PPage);
|
||||
PRPanel.Parent := PPage;
|
||||
@ -276,8 +276,8 @@ begin
|
||||
|
||||
Bitmap := TfrBarCodeView(View).GenerateBitmap;
|
||||
try
|
||||
w := Round(Bitmap.Width * PDFEscx + 1) ;
|
||||
h := Round(Bitmap.Height * PDFEscy + 1) ;
|
||||
w := trunc(Bitmap.Width * PDFEscx + 1.5) ;
|
||||
h := trunc(Bitmap.Height * PDFEscy + 1.5) ;
|
||||
|
||||
PRImage := TPRImage.Create(PRPanel);
|
||||
PRImage.Parent := PRPanel;
|
||||
@ -321,14 +321,14 @@ begin
|
||||
if (w/h) < r then
|
||||
begin
|
||||
L := h;
|
||||
h := Round(w/r);
|
||||
h := trunc(w/r + 0.5);
|
||||
if (View.Flags and flPictCenter<>0) then
|
||||
y := y + (L-h) div 2;
|
||||
end
|
||||
else
|
||||
begin
|
||||
L := w;
|
||||
w := Round(h*r);
|
||||
w := trunc(h*r + 0.5);
|
||||
if (View.Flags and flPictCenter<>0) then
|
||||
x := x + (L-w) div 2;
|
||||
end;
|
||||
@ -366,7 +366,7 @@ begin
|
||||
else
|
||||
begin
|
||||
|
||||
SWidth := Round((View.RoundRectCurve/2) * PDFEscx);
|
||||
SWidth := trunc((View.RoundRectCurve/2) * PDFEscx + 0.5);
|
||||
if View.RoundRect then
|
||||
Data.Radius := SWidth
|
||||
else
|
||||
@ -379,7 +379,7 @@ begin
|
||||
Data.FrameColor := Data.FillColor; //ColorToRGB(View.FrameColor);
|
||||
Data.FrameWidth := 0;
|
||||
Data.FrameStyle := frsSolid;
|
||||
SWidth := Round(View.ShadowWidth * PDFEscx);
|
||||
SWidth := trunc(View.ShadowWidth * PDFEscx + 0.5);
|
||||
if View.ShadowWidth>0 then
|
||||
AddShape(Data, x + SWidth, y + SWidth, h - SWidth, w - SWidth);
|
||||
|
||||
@ -417,10 +417,10 @@ procedure TfrTNPDFExportFilter.OnData(x, y: Integer; View: TfrView);
|
||||
var
|
||||
nx, ny, ndx, ndy: Integer;
|
||||
begin
|
||||
nx := Round(x * PDFEscx);
|
||||
ny := Round(y * PDFEscy);
|
||||
ndx := Round((View.dx) * PDFEscx + 1) ;
|
||||
ndy := Round((View.dy) * PDFEscy + 1) ;
|
||||
nx := trunc(x * PDFEscx + 0.5);
|
||||
ny := trunc(y * PDFEscy + 0.5);
|
||||
ndx := trunc((View.dx) * PDFEscx + 1.5) ;
|
||||
ndy := trunc((View.dy) * PDFEscy + 1.5) ;
|
||||
|
||||
if View is TfrShapeView then begin
|
||||
|
||||
@ -439,16 +439,15 @@ procedure TfrTNPDFExportFilter.OnText(X, Y: Integer; const Text: string;
|
||||
View: TfrView);
|
||||
var
|
||||
PRTLabel: TPRLabel;
|
||||
nx, ny,
|
||||
ndx, ndy: Integer;
|
||||
nx, ny, ndx, ndy: Integer;
|
||||
gapx, gapy: integer;
|
||||
begin
|
||||
gapx := Round(View.FrameWidth / 2) + 2;
|
||||
gapy := Round(View.FrameWidth / 2) div 2 + 1;
|
||||
nx := Round((x+gapx) * PDFEscx) + 1;
|
||||
ny := Round((y+gapy) * PDFEscy) + 1;
|
||||
ndx := Round((View.dx-gapx) * PDFEscx);
|
||||
ndy := Round((View.dy-gapy) * PDFEscy);
|
||||
gapx := trunc(View.FrameWidth / 2 + 0.5) + 2;
|
||||
gapy := trunc(View.FrameWidth / 4 + 0.5) + 1;
|
||||
nx := trunc((x+gapx) * PDFEscx + 0.5);
|
||||
ny := trunc((y+gapy) * PDFEscy + 0.5);
|
||||
ndx := trunc((View.dx-gapx) * PDFEscx + 1.5);
|
||||
ndy := trunc((View.dy-gapy) * PDFEscy + 1.5);
|
||||
|
||||
PRTLabel := TPRLabel.Create(PRPanel);
|
||||
PRTLabel.Parent := PRPanel;
|
||||
|
@ -3172,7 +3172,10 @@ var
|
||||
if not Exporting then
|
||||
canvas.TextOut(curx,cury,str)
|
||||
else
|
||||
CurReport.InternalOnExportText(CurX, Y, str, Self);
|
||||
if Angle <> 0 then
|
||||
CurReport.InternalOnExportText(CurX, CurY, str, Self)
|
||||
else
|
||||
CurReport.InternalOnExportText(CurX, Y, str, Self);
|
||||
Inc(CurStrNo);
|
||||
curx := curx + th;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user