mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-07 12:38:30 +01:00
Qt,Qt5: fixed wrong PPI calculation. issue #34625
git-svn-id: trunk@59708 -
This commit is contained in:
parent
7e4591f52c
commit
5db60e1bdd
@ -259,8 +259,16 @@ begin
|
||||
|
||||
ScreenDC := GetDC(0);
|
||||
try
|
||||
{$IFDEF DARWIN}
|
||||
// this code is removed in r57679, and cocoa/carbon are fixed separatelly, so
|
||||
// qt/qt5 wasn't good with standard mac ppi 72. Cocoa ws uses CocoaBasePPI const.
|
||||
// issue #34625
|
||||
ScreenInfo.PixelsPerInchX := 96;
|
||||
ScreenInfo.PixelsPerInchY := 96;
|
||||
{$ELSE}
|
||||
ScreenInfo.PixelsPerInchX := GetDeviceCaps(ScreenDC, LOGPIXELSX);
|
||||
ScreenInfo.PixelsPerInchY := GetDeviceCaps(ScreenDC, LOGPIXELSY);
|
||||
{$ENDIF}
|
||||
ScreenInfo.ColorDepth := GetDeviceCaps(ScreenDC, BITSPIXEL);
|
||||
finally
|
||||
ReleaseDC(0, ScreenDC);
|
||||
|
||||
@ -207,13 +207,21 @@ begin
|
||||
|
||||
ScreenDC := GetDC(0);
|
||||
try
|
||||
{$IFDEF DARWIN}
|
||||
// this code is removed in r57679, and cocoa/carbon are fixed separatelly, so
|
||||
// qt/qt5 wasn't good with standard mac ppi 72. Cocoa ws uses CocoaBasePPI const.
|
||||
// issue #34625
|
||||
ScreenInfo.PixelsPerInchX := 96;
|
||||
ScreenInfo.PixelsPerInchY := 96;
|
||||
{$ELSE}
|
||||
ScreenInfo.PixelsPerInchX := GetDeviceCaps(ScreenDC, LOGPIXELSX);
|
||||
ScreenInfo.PixelsPerInchY := GetDeviceCaps(ScreenDC, LOGPIXELSY);
|
||||
{$ENDIF}
|
||||
ScreenInfo.ColorDepth := GetDeviceCaps(ScreenDC, BITSPIXEL);
|
||||
finally
|
||||
ReleaseDC(0, ScreenDC);
|
||||
end;
|
||||
|
||||
|
||||
QtDefaultPrinter;
|
||||
{$IFNDEF MSWINDOWS}
|
||||
// initialize clipboard
|
||||
|
||||
Loading…
Reference in New Issue
Block a user