richmemo: modified print from pageRect to margins (double) for paragraph's consistency.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4059 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2015-03-21 03:41:19 +00:00
parent beca637d7c
commit 72db518cb9
2 changed files with 12 additions and 13 deletions

View File

@ -104,11 +104,16 @@ type
end;
type
TRectOffsets = record
Left : Double;
Top : Double;
Right : Double;
Bottom : Double;
end;
TPrintParams = record
Title : String;
PageRect : TRect; // position of the printed page in points
// points are relative to the physical page (paper) size
// not DPI of the printer
Margins : TRectOffsets; // margins in points
SelStart : Integer;
SelLength : Integer;
end;

View File

@ -1027,16 +1027,10 @@ begin
,round(APrinter.PageHeight / LogY * TWIP_INCH)
);
if not IsRectEmpty(AParams.PageRect) then begin
Rng.rc.left := round(AParams.PageRect.Left * TWIP_PT);
Rng.rc.top := round(AParams.PageRect.Top * TWIP_PT);
Rng.rc.right := round(AParams.PageRect.Right * TWIP_PT);
Rng.rc.bottom := round(AParams.PageRect.Bottom * TWIP_PT);
end else begin
//todo: use PhysicalOffset?
Rng.rc:=Rng.rcPage;
end;
if not DoPrint then Rng.rcPage.bottom:=Rng.rc.bottom;
Rng.rc.left := round(AParams.Margins.Left * TWIP_PT);
Rng.rc.top := round(AParams.Margins.Top * TWIP_PT);
Rng.rc.right := round(Rng.rcPage.Right - AParams.Margins.Right * TWIP_PT);
Rng.rc.bottom := round(Rng.rcPage.Bottom - AParams.Margins.Bottom * TWIP_PT);
SaveRect:=Rng.rc;
if AParams.SelLength<=0 then begin