diff options
author | Neil <nyamatongwe@gmail.com> | 2016-10-26 08:27:35 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2016-10-26 08:27:35 +1100 |
commit | 7ee60fc25a08dac31ccdfb77068aae852860cc37 (patch) | |
tree | aade0daf566683251555bed0cc5af545664e92c0 /src/Editor.cxx | |
parent | acb772397633f7c46d31b12f96321a2a2f26d80b (diff) | |
download | scintilla-mirror-7ee60fc25a08dac31ccdfb77068aae852860cc37.tar.gz |
Moved location to margin code from Editor to ViewStyle.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index f721c4361..62bc60a09 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2424,13 +2424,7 @@ void Editor::NotifyIndicatorClick(bool click, int position, bool shift, bool ctr } bool Editor::NotifyMarginClick(Point pt, int modifiers) { - int marginClicked = -1; - int x = vs.textStart - vs.fixedColumnWidth; - for (size_t margin = 0; margin < vs.ms.size(); margin++) { - if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width)) - marginClicked = static_cast<int>(margin); - x += vs.ms[margin].width; - } + const int marginClicked = vs.MarginFromLocation(pt); if ((marginClicked >= 0) && vs.ms[marginClicked].sensitive) { int position = pdoc->LineStart(LineFromLocation(pt)); if ((vs.ms[marginClicked].mask & SC_MASK_FOLDERS) && (foldAutomatic & SC_AUTOMATICFOLD_CLICK)) { |