You've already forked lazarus-ccr
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:
@ -104,11 +104,16 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
TRectOffsets = record
|
||||||
|
Left : Double;
|
||||||
|
Top : Double;
|
||||||
|
Right : Double;
|
||||||
|
Bottom : Double;
|
||||||
|
end;
|
||||||
|
|
||||||
TPrintParams = record
|
TPrintParams = record
|
||||||
Title : String;
|
Title : String;
|
||||||
PageRect : TRect; // position of the printed page in points
|
Margins : TRectOffsets; // margins in points
|
||||||
// points are relative to the physical page (paper) size
|
|
||||||
// not DPI of the printer
|
|
||||||
SelStart : Integer;
|
SelStart : Integer;
|
||||||
SelLength : Integer;
|
SelLength : Integer;
|
||||||
end;
|
end;
|
||||||
|
@ -1027,16 +1027,10 @@ begin
|
|||||||
,round(APrinter.PageHeight / LogY * TWIP_INCH)
|
,round(APrinter.PageHeight / LogY * TWIP_INCH)
|
||||||
);
|
);
|
||||||
|
|
||||||
if not IsRectEmpty(AParams.PageRect) then begin
|
Rng.rc.left := round(AParams.Margins.Left * TWIP_PT);
|
||||||
Rng.rc.left := round(AParams.PageRect.Left * TWIP_PT);
|
Rng.rc.top := round(AParams.Margins.Top * TWIP_PT);
|
||||||
Rng.rc.top := round(AParams.PageRect.Top * TWIP_PT);
|
Rng.rc.right := round(Rng.rcPage.Right - AParams.Margins.Right * TWIP_PT);
|
||||||
Rng.rc.right := round(AParams.PageRect.Right * TWIP_PT);
|
Rng.rc.bottom := round(Rng.rcPage.Bottom - AParams.Margins.Bottom * 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;
|
|
||||||
SaveRect:=Rng.rc;
|
SaveRect:=Rng.rc;
|
||||||
|
|
||||||
if AParams.SelLength<=0 then begin
|
if AParams.SelLength<=0 then begin
|
||||||
|
Reference in New Issue
Block a user