Printers: Cocoa: fix reported paper dimensions (fix LazReport designer)

git-svn-id: trunk@62455 -
This commit is contained in:
jesus 2019-12-29 19:13:34 +00:00
parent f38e21c5ae
commit 8aae6bd0f3
2 changed files with 12 additions and 7 deletions

View File

@ -144,7 +144,12 @@ var
aInfo: NSPrintInfo;
validationResult: Boolean;
pmOr: PMOrientation;
kx, ky: Double;
begin
kx := XDPI/72;
ky := YDPI/72;
aInfo := NSPrintInfo.sharedPrintInfo;
if aInfo.orientation=NSPortraitOrientation then
pmOr := kPMPortrait
@ -188,13 +193,13 @@ begin
PaperRect.PhysicalRect.Left := 0;
PaperRect.PhysicalRect.Top := 0;
PaperRect.PhysicalRect.Right := Round(paperR.right - paperR.left);
PaperRect.PhysicalRect.Bottom := Round(paperR.bottom - paperR.top);
PaperRect.PhysicalRect.Right := Round((paperR.right - paperR.left)*kx);
PaperRect.PhysicalRect.Bottom := Round((paperR.bottom - paperR.top)*ky);
PaperRect.WorkRect.Left := Round(-paperR.left);
PaperRect.WorkRect.Top := Round(-paperR.top);
PaperRect.WorkRect.Right := Round(pageR.right - pageR.left - paperR.left);
PaperRect.WorkRect.Bottom := Round(pageR.bottom - pageR.top - paperR.top);
PaperRect.WorkRect.Left := Round(-paperR.left*kx);
PaperRect.WorkRect.Top := Round(-paperR.top*ky);
PaperRect.WorkRect.Right := Round((pageR.right - pageR.left - paperR.left)*kx);
PaperRect.WorkRect.Bottom := Round((pageR.bottom - pageR.top - paperR.top)*ky);
end;
end;

View File

@ -70,7 +70,7 @@
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsStabs"/>
<DebugInfoType Value="dsDwarf2"/>
</Debugging>
<Options>
<Win32>