diff options
| author | Neil <nyamatongwe@gmail.com> | 2014-06-26 16:11:15 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2014-06-26 16:11:15 +1000 | 
| commit | 6964d2a7f004e755b1e32f334597ca7408d2ce28 (patch) | |
| tree | 02f09c4ef2745e247ea9cdc3f31e9834c89b0697 /src | |
| parent | cbbfaec78bd3f516cc2d0bcece0945d80f533d78 (diff) | |
| download | scintilla-mirror-6964d2a7f004e755b1e32f334597ca7408d2ce28.tar.gz | |
Move decision to draw line end wrap marker and colour of marker to DrawEOL.
Simplifies arguments to DrawEOL and shortens DrawLine.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 30 | ||||
| -rw-r--r-- | src/Editor.h | 3 | 
2 files changed, 14 insertions, 19 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 2b1ddf172..db0aecf43 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2500,7 +2500,7 @@ void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle rcSegmen  void Editor::DrawEOL(Surface *surface, const ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,          int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, -        ColourOptional background, bool drawWrapMarkEnd, ColourDesired wrapColour) { +        ColourOptional background) {  	const int posLineStart = pdoc->LineStart(line);  	PRectangle rcSegment = rcLine; @@ -2633,6 +2633,14 @@ void Editor::DrawEOL(Surface *surface, const ViewStyle &vsDraw, PRectangle rcLin  		}  	} +	bool drawWrapMarkEnd = false; + +	if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) { +		if (subLine + 1 < ll->lines) { +			drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0; +		} +	} +  	if (drawWrapMarkEnd) {  		PRectangle rcPlace = rcSegment; @@ -2644,7 +2652,7 @@ void Editor::DrawEOL(Surface *surface, const ViewStyle &vsDraw, PRectangle rcLin  			rcPlace.right = rcLine.right;  			rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;  		} -		DrawWrapMarker(surface, rcPlace, true, wrapColour); +		DrawWrapMarker(surface, rcPlace, true, vsDraw.WrapColour());  	}  } @@ -2804,16 +2812,6 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l  		}  	} -	const ColourDesired wrapColour = vsDraw.WrapColour(); - -	bool drawWrapMarkEnd = false; - -	if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) { -		if (subLine + 1 < ll->lines) { -			drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0; -		} -	} -  	if (ll->wrapIndent != 0) {  		bool continuedWrapLine = false; @@ -2844,7 +2842,7 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l  				else  					rcPlace.right = rcPlace.left + vsDraw.aveCharWidth; -				DrawWrapMarker(surface, rcPlace, false, wrapColour); +				DrawWrapMarker(surface, rcPlace, false, vsDraw.WrapColour());  			}  			xStart += static_cast<int>(ll->wrapIndent); @@ -2921,8 +2919,7 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l  		}  		DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd, -		        xStart, subLine, subLineStart, background, -		        drawWrapMarkEnd, wrapColour); +		        xStart, subLine, subLineStart, background);  	}  	DrawIndicators(surface, vsDraw, line, xStart, rcLine, ll, subLine, lineEnd, true); @@ -3149,8 +3146,7 @@ void Editor::DrawLine(Surface *surface, const ViewStyle &vsDraw, int line, int l  	// End of the drawing of the current line  	if (!twoPhaseDraw) {  		DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd, -		        xStart, subLine, subLineStart, background, -		        drawWrapMarkEnd, wrapColour); +		        xStart, subLine, subLineStart, background);  	}  	if (!hideSelection && ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha != SC_ALPHA_NOALPHA))) {  		// For each selection draw diff --git a/src/Editor.h b/src/Editor.h index 7a84690af..c7d44c16d 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -442,8 +442,7 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	static void DrawWrapMarker(Surface *surface, PRectangle rcPlace, bool isEndMarker, ColourDesired wrapColour);  	void DrawEOL(Surface *surface, const ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,  		int line, int lineEnd, int xStart, int subLine, XYACCUMULATOR subLineStart, -		ColourOptional background, -		bool drawWrapMark, ColourDesired wrapColour); +		ColourOptional background);  	static void DrawIndicator(int indicNum, int startPos, int endPos, Surface *surface, const ViewStyle &vsDraw,  		int xStart, PRectangle rcLine, LineLayout *ll, int subLine);  	void DrawIndicators(Surface *surface, const ViewStyle &vsDraw, int line, int xStart, | 
