diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2013-08-20 13:54:04 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2013-08-20 13:54:04 +1000 |
commit | 0e77bdd99fd710266152d2e092d28d10c5dedfbf (patch) | |
tree | 6abba86f3a5b2104e094629f7a53c1d1b8b44322 /src | |
parent | 42f803af27c398e1ef78541832e602c69cbc6d47 (diff) | |
download | scintilla-mirror-0e77bdd99fd710266152d2e092d28d10c5dedfbf.tar.gz |
Fix bug where coordinates were relative to the text view instead of the whole view.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 14 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 4 | ||||
-rw-r--r-- | src/ViewStyle.h | 1 |
3 files changed, 14 insertions, 5 deletions
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); diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 7ef4f8cb3..5e2ad1ee7 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -409,6 +409,10 @@ bool ViewStyle::ProtectionActive() const { return someStylesProtected; } +int ViewStyle::ExternalMarginWidth() const { + return marginInside ? 0 : fixedColumnWidth; +} + bool ViewStyle::ValidStyle(size_t styleIndex) const { return styleIndex < styles.size(); } diff --git a/src/ViewStyle.h b/src/ViewStyle.h index 0222af591..244f5c508 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -166,6 +166,7 @@ public: void ClearStyles(); void SetStyleFontName(int styleIndex, const char *name); bool ProtectionActive() const; + int ExternalMarginWidth() const; bool ValidStyle(size_t styleIndex) const; void CalcLargestMarkerHeight(); ColourDesired WrapColour() const; |