summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-08-28 15:37:45 +0000
committerManolo Gouy <Manolo>2016-08-28 15:37:45 +0000
commit0e404ab7d738de85f4f4023d2eb32a9b6ab1a854 (patch)
treea589aa82ae573d1629118f0604f0d326a648e76c /src
parent87d28f5eab6a3d41af12425eb684175930416455 (diff)
Fix slight mis-scaling when pasting Enhanced metafile from clipboard
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11904 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_win32.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index f0229919f..ba68ec0ac 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -763,14 +763,11 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch
HDC hdc = GetDC(NULL); // get unit correspondance between .01 mm and screen pixels
int hmm = GetDeviceCaps(hdc, HORZSIZE);
int hdots = GetDeviceCaps(hdc, HORZRES);
- int vmm = GetDeviceCaps(hdc, VERTSIZE);
- int vdots = GetDeviceCaps(hdc, VERTRES);
ReleaseDC(NULL, hdc);
- float factorw = (100.f * hmm) / hdots;
- float factorh = (100.f * vmm) / vdots + 0.5f;
- width = (int)(width/factorw); height = (int)(height/factorh); // convert to screen pixel unit
+ float factor = (100.f * hmm) / hdots;
float scaling = Fl_WinAPI_Screen_Driver::desktop_scaling_factor();
- width *= scaling; height *= scaling;
+ width = int(width * scaling / factor); // convert to screen pixel unit
+ height = int(height * scaling / factor);
RECT rect = {0, 0, width, height};
Fl_Offscreen off = fl_create_offscreen(width, height);
fl_begin_offscreen(off);