diff options
| author | Manolo Gouy <Manolo> | 2018-04-26 11:51:28 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-04-26 11:51:28 +0000 |
| commit | dd93cbd88860b142dc7fff99956cbf88b403be03 (patch) | |
| tree | f153232874e829d7a7c8a93ec091ff5e409cfe86 /src | |
| parent | 069ab1b54fe658fa9b692d6a1a438e21b54acfa2 (diff) | |
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
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_win32.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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}; |
