aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-04-11 22:10:07 +1000
committernyamatongwe <unknown>2012-04-11 22:10:07 +1000
commit5bf72150a3990937a07a1cea6c8d62eafee49cad (patch)
tree03eb309f492912a5edb660beb53f6f57f52acf81 /src
parente8f0b159b82682a548a6a28c3dd833455bb81dcc (diff)
downloadscintilla-mirror-5bf72150a3990937a07a1cea6c8d62eafee49cad.tar.gz
Bug #3514882. Properly draw translucent whole line states, by respecting right
margin and also not going out of bounds. Don't go out of bounds into right margin when drawing beyond EOF area. From Marko Njezic.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 1f6ac5b34..a41a5e24a 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2646,8 +2646,8 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
rcPlace.left = xEol + xStart + virtualSpace;
rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
} else {
- // draw left of the right text margin, to avoid clipping by the current clip rect
- rcPlace.right = rcLine.right - vs.rightMarginWidth;
+ // rcLine is clipped to text area
+ rcPlace.right = rcLine.right;
rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;
}
DrawWrapMarker(surface, rcPlace, true, wrapColour);
@@ -3257,8 +3257,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
// Draw any translucent whole line states
- rcSegment.left = 0;
- rcSegment.right = rcLine.right - 1;
+ rcSegment = rcLine;
if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground, vsDraw.caretLineAlpha);
}
@@ -3590,12 +3589,13 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
posCaret = posDrag;
int lineCaret = pdoc->LineFromPosition(posCaret.Position());
+ PRectangle rcTextArea = rcClient;
+ rcTextArea.left = vs.fixedColumnWidth;
+ rcTextArea.right -= vs.rightMarginWidth;
+
// Remove selection margin from drawing area so text will not be drawn
// on it in unbuffered mode.
if (!bufferedDraw) {
- PRectangle rcTextArea = rcClient;
- rcTextArea.left = vs.fixedColumnWidth;
- rcTextArea.right -= vs.rightMarginWidth;
surfaceWindow->SetClip(rcTextArea);
}
@@ -3633,7 +3633,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
GetHotSpotRange(ll->hsStart, ll->hsEnd);
- PRectangle rcLine = rcClient;
+ PRectangle rcLine = rcTextArea;
rcLine.top = ypos;
rcLine.bottom = ypos + vs.lineHeight;
@@ -3707,7 +3707,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
// Right column limit indicator
PRectangle rcBeyondEOF = rcClient;
rcBeyondEOF.left = vs.fixedColumnWidth;
- rcBeyondEOF.right = rcBeyondEOF.right;
+ rcBeyondEOF.right = rcBeyondEOF.right - vs.rightMarginWidth;
rcBeyondEOF.top = (cs.LinesDisplayed() - topLine) * vs.lineHeight;
if (rcBeyondEOF.top < rcBeyondEOF.bottom) {
surfaceWindow->FillRectangle(rcBeyondEOF, vs.styles[STYLE_DEFAULT].back);