diff options
| author | Manolo Gouy <Manolo> | 2016-08-27 15:54:51 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-08-27 15:54:51 +0000 |
| commit | fd2da982b625109efe50a0c9351bf6dd5abc8aae (patch) | |
| tree | 6606b6d9d16ded16444ad74de8211d80b8a66439 /src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx | |
| parent | f551d538f23ddf810e7401a2d25de54dc5f15f75 (diff) | |
Fix Fl_Copy_Surface under Windows 10 when the desktop scaling factor value is > 100 %
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11899 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx')
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx index 1a7a88b27..2d0ab4760 100644 --- a/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Copy_Surface_Driver.cxx @@ -22,6 +22,7 @@ #include <FL/Fl_Copy_Surface.H> #include <FL/x.H> #include "Fl_GDI_Graphics_Driver.H" +#include "../WinAPI/Fl_WinAPI_Screen_Driver.H" #include <windows.h> class Fl_GDI_Copy_Surface_Driver : public Fl_Copy_Surface_Driver { @@ -58,8 +59,10 @@ Fl_GDI_Copy_Surface_Driver::Fl_GDI_Copy_Surface_Driver(int w, int h) : Fl_Copy_S ReleaseDC(NULL, hdc); float factorw = (100.f * hmm) / hdots; float factorh = (100.f * vmm) / vdots; + // Global display scaling factor: 1, 1.25, 1.5, 1.75, etc... + float scaling = Fl_WinAPI_Screen_Driver::desktop_scaling_factor(); - RECT rect; rect.left = 0; rect.top = 0; rect.right = (LONG)(w * factorw); rect.bottom = (LONG)(h * factorh); + RECT rect; rect.left = 0; rect.top = 0; rect.right = (LONG)((w/scaling) * factorw); rect.bottom = (LONG)((h/scaling) * factorh); gc = CreateEnhMetaFile (NULL, NULL, &rect, NULL); if (gc != NULL) { SetTextAlign(gc, TA_BASELINE|TA_LEFT); |
