From dd93cbd88860b142dc7fff99956cbf88b403be03 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 26 Apr 2018 11:51:28 +0000 Subject: Fix Fl_WinAPI_System_Driver::paste() when clipboard contains an image and the GUI is scaled. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12873 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index c5fe41acf..59f8f7526 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -847,6 +847,10 @@ void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const ch ReleaseDC(NULL, hdc); float factor = (100.f * hmm) / hdots; float scaling = Fl::screen_driver()->scale(receiver.top_window()->driver()->screen_num()); + if (!Fl_Window::current()) { + Fl_GDI_Graphics_Driver *d = (Fl_GDI_Graphics_Driver*)&Fl_Graphics_Driver::default_driver(); + d->scale(scaling);// may run early at app startup before Fl_Window::make_current() scales d + } width = int(width / (scaling * factor)); // convert to screen pixel unit height = int(height / (scaling * factor)); RECT rect = {0, 0, width, height}; -- cgit v1.2.3