From 9d024ceb7ea340d2d140939e83f6c78846fbdc5c Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 7 Jul 2017 08:04:45 +0000 Subject: 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 --- src/fl_dnd_win32.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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 #include #include +#include #include #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(); -- cgit v1.2.3