aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2013-08-20 13:54:04 +1000
committernyamatongwe <nyamatongwe@gmail.com>2013-08-20 13:54:04 +1000
commit8b26f479923b34452ee12d38d79dfac47e9ff1d6 (patch)
tree5e00178825cdc1f5a6786257e827755ea244161f
parentf69338319ce627f3d760fc1ea74c02cec4fc6118 (diff)
downloadscintilla-mirror-8b26f479923b34452ee12d38d79dfac47e9ff1d6.tar.gz
Fix bug where coordinates were relative to the text view instead of the whole view.
-rw-r--r--src/Editor.cxx14
-rw-r--r--src/ViewStyle.cxx4
-rw-r--r--src/ViewStyle.h1
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;