summaryrefslogtreecommitdiff
path: root/src/corelib/gdi/fpg_gdi.pas
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2013-05-20 11:37:35 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2013-05-20 11:37:35 +0100
commitd10dac387ba331f1f289b28b4d1a56a7882733f2 (patch)
tree53eb563f65667a0f9b23e3c078e65eed7e999851 /src/corelib/gdi/fpg_gdi.pas
parent13468500f5ffa00c790d9c59779e45b7cba14e93 (diff)
downloadfpGUI-d10dac387ba331f1f289b28b4d1a56a7882733f2.tar.xz
bug: Under Windows the mouse coordinates in OnDragDrop was screen coordinates.
I forgot to translate those to widget coordinates.
Diffstat (limited to 'src/corelib/gdi/fpg_gdi.pas')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index c8460a4c..74787683 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -1522,6 +1522,7 @@ var
swg: TfpgWidget; { source widget }
CF: DWORD;
lIsTranslated: Boolean;
+ lPoint: Windows.Point;
begin
if not FUserAcceptDrag then
exit;
@@ -1547,7 +1548,11 @@ begin
swg := uDragSource as TfpgWidget
else
swg := nil;
- wg.OnDragDrop(wg, swg, pt.x, pt.y, data);
+ // convert mouse screen coordinates to widget coordinates
+ lPoint.x := pt.x;
+ lPoint.y := pt.y;
+ ScreenToClient(wg.WinHandle, lPoint);
+ wg.OnDragDrop(wg, swg, lPoint.x, lPoint.y, data);
uDragSource := nil;
end;
GlobalUnlock(stgmed.HGLOBAL);