diff options
| author | Manolo Gouy <Manolo> | 2017-07-07 08:04:45 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-07-07 08:04:45 +0000 |
| commit | 9d024ceb7ea340d2d140939e83f6c78846fbdc5c (patch) | |
| tree | acc0b63b2eb7a7432f89b24537e2a4118ffd253d /src/fl_dnd_win32.cxx | |
| parent | e562ec02a6914259a0e07676d4b7f75d90ee4976 (diff) | |
Fix drag-n-drop for WIN32 platform when rescaling is active.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12293 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_dnd_win32.cxx')
| -rw-r--r-- | src/fl_dnd_win32.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx index 8efb8dcbb..0d7f1c1b1 100644 --- a/src/fl_dnd_win32.cxx +++ b/src/fl_dnd_win32.cxx @@ -23,6 +23,7 @@ #include <FL/Fl.H> #include <FL/x.H> #include <FL/Fl_Window.H> +#include <FL/Fl_Window_Driver.H> #include <FL/fl_utf8.h> #include "drivers/WinAPI/Fl_WinAPI_Screen_Driver.H" #include "flstring.h" @@ -89,6 +90,9 @@ public: HWND hWnd = WindowFromPoint( ppt ); Fl_Window *target = fl_find( hWnd ); if (target) { + float s = Fl::screen_driver()->scale(target->driver()->screen_num()); + Fl::e_x_root /= s; + Fl::e_y_root /= s; Fl::e_x = Fl::e_x_root-target->x(); Fl::e_y = Fl::e_y_root-target->y(); } @@ -121,6 +125,9 @@ public: Fl::e_x_root = pt.x; Fl::e_y_root = pt.y; if (fl_dnd_target_window) { + float s = Fl::screen_driver()->scale(fl_dnd_target_window->driver()->screen_num()); + Fl::e_x_root /= s; + Fl::e_y_root /= s; Fl::e_x = Fl::e_x_root-fl_dnd_target_window->x(); Fl::e_y = Fl::e_y_root-fl_dnd_target_window->y(); } @@ -155,6 +162,9 @@ public: fl_dnd_target_window = 0; Fl::e_x_root = pt.x; Fl::e_y_root = pt.y; + float s = Fl::screen_driver()->scale(target->driver()->screen_num()); + Fl::e_x_root /= s; + Fl::e_y_root /= s; if (target) { Fl::e_x = Fl::e_x_root-target->x(); Fl::e_y = Fl::e_y_root-target->y(); |
