From 59a2c47ed03ac40ec5a612cb74667dc70900dff5 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 16 Jan 2015 09:48:30 +1100 Subject: When the mouse is on the line between margin and text changed to treat as within text. Helps on PLAT_CURSES. --- doc/ScintillaHistory.html | 4 ++++ include/Platform.h | 5 +++++ src/Editor.cxx | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 35847dcf6..5fb8eb4b1 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -526,6 +526,10 @@ Bug #1575.
  • + When the mouse is on the line between margin and text changed to treat as within text. + This makes the PLAT_CURSES character cell platform work better. +
  • +
  • Fix a crash in SciTE when the command line is just "-close:". Bug #1675.
  • diff --git a/include/Platform.h b/include/Platform.h index 4bba252f2..c4a1a0b40 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -144,6 +144,11 @@ public: return (pt.x >= left) && (pt.x <= right) && (pt.y >= top) && (pt.y <= bottom); } + bool ContainsWholePixel(Point pt) const { + // Does the rectangle contain all of the pixel to left/below the point + return (pt.x >= left) && ((pt.x+1) <= right) && + (pt.y >= top) && ((pt.y+1) <= bottom); + } bool Contains(PRectangle rc) const { return (rc.left >= left) && (rc.right <= right) && (rc.top >= top) && (rc.bottom <= bottom); diff --git a/src/Editor.cxx b/src/Editor.cxx index 4902dbdc8..8cf77ead1 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -4008,7 +4008,7 @@ bool Editor::PointInSelMargin(Point pt) const { PRectangle rcSelMargin = GetClientRectangle(); rcSelMargin.right = static_cast(vs.textStart - vs.leftMarginWidth); rcSelMargin.left = static_cast(vs.textStart - vs.fixedColumnWidth); - return rcSelMargin.Contains(pt); + return rcSelMargin.ContainsWholePixel(pt); } else { return false; } -- cgit v1.2.3