aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-07-28 13:35:50 +1000
committerNeil <nyamatongwe@gmail.com>2020-07-28 13:35:50 +1000
commit6ba506fe9236027a5d4606b2498f90c935c66e46 (patch)
tree7008dd6e5d226b32762952c8183bc4f0e6ba16c5
parent4da1d7953a20c180e7659795bd50ca83b53b39cd (diff)
downloadscintilla-mirror-6ba506fe9236027a5d4606b2498f90c935c66e46.tar.gz
Fix position of marker symbols for SC_MARGIN_RTEXT which were being moved based
on width of text.
-rw-r--r--doc/ScintillaHistory.html12
-rw-r--r--src/MarginView.cxx13
2 files changed, 20 insertions, 5 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 526da9f91..564ebf7eb 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -577,6 +577,18 @@
Released 21 July 2020.
</li>
<li>
+ Fix position of marker symbols for SC_MARGIN_RTEXT which were being moved based on
+ width of text.
+ </li>
+ </ul>
+ <h3>
+ <a href="https://www.scintilla.org/scite444.zip">Release 4.4.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 21 July 2020.
+ </li>
+ <li>
End of line annotations implemented.
<a href="https://sourceforge.net/p/scintilla/bugs/2141/">Bug #2141</a>.
</li>
diff --git a/src/MarginView.cxx b/src/MarginView.cxx
index 5aadd4831..8fc24496f 100644
--- a/src/MarginView.cxx
+++ b/src/MarginView.cxx
@@ -365,9 +365,11 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,
marks &= vs.ms[margin].mask;
- PRectangle rcMarker = rcSelMargin;
- rcMarker.top = static_cast<XYPOSITION>(yposScreen);
- rcMarker.bottom = static_cast<XYPOSITION>(yposScreen + vs.lineHeight);
+ PRectangle rcMarker(
+ rcSelMargin.left,
+ static_cast<XYPOSITION>(yposScreen),
+ rcSelMargin.right,
+ static_cast<XYPOSITION>(yposScreen + vs.lineHeight));
if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
if (firstSubLine) {
std::string sNumber;
@@ -413,11 +415,12 @@ void MarginView::PaintMargin(Surface *surface, Sci::Line topLine, PRectangle rc,
if (firstSubLine) {
surface->FillRectangle(rcMarker,
vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);
+ PRectangle rcText = rcMarker;
if (vs.ms[margin].style == SC_MARGIN_RTEXT) {
const int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin);
- rcMarker.left = rcMarker.right - width - 3;
+ rcText.left = rcText.right - width - 3;
}
- DrawStyledText(surface, vs, vs.marginStyleOffset, rcMarker,
+ DrawStyledText(surface, vs, vs.marginStyleOffset, rcText,
stMargin, 0, stMargin.length, drawAll);
} else {
// if we're displaying annotation lines, colour the margin to match the associated document line