diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 7989c5d69..455375951 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -786,10 +786,13 @@ void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) { int hdots = GetDeviceCaps(hdc, HORZRES); int vmm = GetDeviceCaps(hdc, VERTSIZE); int vdots = GetDeviceCaps(hdc, VERTRES); + int dhr = GetDeviceCaps(hdc, DESKTOPHORZRES); // true number of pixels on display ReleaseDC(NULL, hdc); + // Global display scaling factor: 1, 1.25, 1.5, 1.75, etc... + float scaling = dhr/float(hdots); 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 + width = (int)(width*scaling/factorw); height = (int)(height*scaling/factorh); // convert to screen pixel unit RECT rect = {0, 0, width, height}; Fl_Offscreen off = fl_create_offscreen(width, height); fl_begin_offscreen(off);