]> git.saurik.com Git - wxWidgets.git/commitdiff
added correct coordinate handling
authorKarsten Ballüder <ballueder@usa.net>
Mon, 10 Aug 1998 09:21:28 +0000 (09:21 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Mon, 10 Aug 1998 09:21:28 +0000 (09:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

user/wxLayout/wxlwindow.cpp

index e8dff1fdc3ba74ff4c545e4da289cfb3b4e30564..f20a7374fb26d09918f9943ed965dd9a1c6839fe 100644 (file)
@@ -33,8 +33,13 @@ wxLayoutWindow::OnMouse(wxMouseEvent& event)
    if(m_EventId == 0) // nothing to do
       return;
    
-   m_FindPos.x = event.GetX();
-   m_FindPos.y = event.GetY();
+   // this is unintuitive
+   wxClientDC dc(this);
+   PrepareDC( dc );
+
+   m_FindPos.x = dc.DeviceToLogicalX( event.GetX() );
+   m_FindPos.y = dc.DeviceToLogicalY( event.GetY() );
+
    m_FoundObject = NULL;
 
 #ifdef   WXLAYOUT_DEBUG