]> git.saurik.com Git - wxWidgets.git/commitdiff
Need to convert from physical to logical units inside HitTest
authorJulian Smart <julian@anthemion.co.uk>
Sat, 1 Jul 2006 16:43:54 +0000 (16:43 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 1 Jul 2006 16:43:54 +0000 (16:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextctrl.cpp

index b414fa7bb5f6cd270715fb77c9434d27ff3dfb7f..7503b9ece12166fe5e01c1b92c7899b87ed93dd2 100644 (file)
@@ -1627,8 +1627,12 @@ wxRichTextCtrl::HitTest(const wxPoint& pt,
 {
     wxClientDC dc((wxRichTextCtrl*) this);
     ((wxRichTextCtrl*)this)->PrepareDC(dc);
+    
+    // Buffer uses logical position (relative to start of buffer)
+    // so convert
+    wxPoint pt2 = GetLogicalPoint(pt);
 
-    int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt, *pos);
+    int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt2, *pos);
 
     switch ( hit )
     {
@@ -2017,10 +2021,10 @@ bool wxRichTextCtrl::CanRedo() const
 }
 
 // ----------------------------------------------------------------------------
-// implemenation details
+// implementation details
 // ----------------------------------------------------------------------------
 
-void wxRichTextCtrl::Command(wxCommandEvent & event)
+void wxRichTextCtrl::Command(wxCommandEvent& event)
 {
     SetValue(event.GetString());
     GetEventHandler()->ProcessEvent(event);