diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-06-11 11:45:38 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-06-11 11:45:38 +1000 |
| commit | 87342a6cec6c3239e9891481f7774ffeef4fa71f (patch) | |
| tree | 1bff92b8e29d03e7d9d30a7049aa667ce8f9cb8f /win32/PlatWin.cxx | |
| parent | 877def4f243e1ef5eb39a6132f3969844e00be95 (diff) | |
| download | scintilla-mirror-87342a6cec6c3239e9891481f7774ffeef4fa71f.tar.gz | |
Backport: Bug [#2185]. Fix printing to use correct text size.
Backport of changeset 8301:b006d175ac85.
Diffstat (limited to 'win32/PlatWin.cxx')
| -rw-r--r-- | win32/PlatWin.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 42b1dae53..11dc5d3ed 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -616,7 +616,9 @@ void SurfaceGDI::Init(SurfaceID sid, WindowID wid) { Release(); hdc = static_cast<HDC>(sid); ::SetTextAlign(hdc, TA_BASELINE); - logPixelsY = DpiForWindow(wid); + // Windows on screen are scaled but printers are not. + const bool printing = ::GetDeviceCaps(hdc, TECHNOLOGY) != DT_RASDISPLAY; + logPixelsY = printing ? ::GetDeviceCaps(hdc, LOGPIXELSY) : DpiForWindow(wid); } void SurfaceGDI::InitPixMap(int width, int height, Surface *surface_, WindowID wid) { |
