From 0e77bdd99fd710266152d2e092d28d10c5dedfbf Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 20 Aug 2013 13:54:04 +1000 Subject: Fix bug where coordinates were relative to the text view instead of the whole view. --- src/Editor.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 3a30c52a4..7fa1326a7 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4578,7 +4578,7 @@ void Editor::NotifyDwelling(Point pt, bool state) { SCNotification scn = {0}; scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND; scn.position = PositionFromLocation(pt, true); - scn.x = pt.x; + scn.x = pt.x + vs.ExternalMarginWidth(); scn.y = pt.y; NotifyParent(scn); } @@ -7935,16 +7935,20 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_POSITIONFROMPOINT: - return PositionFromLocation(Point(wParam, lParam), false, false); + return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam), + false, false); case SCI_POSITIONFROMPOINTCLOSE: - return PositionFromLocation(Point(wParam, lParam), true, false); + return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam), + true, false); case SCI_CHARPOSITIONFROMPOINT: - return PositionFromLocation(Point(wParam, lParam), false, true); + return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam), + false, true); case SCI_CHARPOSITIONFROMPOINTCLOSE: - return PositionFromLocation(Point(wParam, lParam), true, true); + return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam), + true, true); case SCI_GOTOLINE: GoToLine(wParam); -- cgit v1.2.3