From 33e4aaabe52d145ebb4b1d3e19fafbc5af8e7fd3 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 11 Apr 2012 22:10:07 +1000 Subject: 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. --- src/Editor.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') 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); -- cgit v1.2.3