diff options
| author | nyamatongwe <unknown> | 2012-08-05 17:40:47 +1000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2012-08-05 17:40:47 +1000 | 
| commit | 89df686f59fb8685498d8b69b7b6850d27505b16 (patch) | |
| tree | f0ec3152833425f69dbb5943c0883bc9ab619a62 | |
| parent | 3fab080786011201c6677e25b31867805e7dbf35 (diff) | |
| download | scintilla-mirror-89df686f59fb8685498d8b69b7b6850d27505b16.tar.gz | |
Avoid poor drawing at right of INDIC_SQUIGGLE.
| -rw-r--r-- | src/Indicator.cxx | 20 | 
1 files changed, 13 insertions, 7 deletions
| diff --git a/src/Indicator.cxx b/src/Indicator.cxx index 68034e424..da75cbb85 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -27,15 +27,21 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r  	surface->PenColour(fore);  	int ymid = (rc.bottom + rc.top) / 2;  	if (style == INDIC_SQUIGGLE) { -		surface->MoveTo(rc.left, rc.top); -		int x = rc.left + 2; -		int y = 2; -		while (x < rc.right) { +		int x = int(rc.left+0.5); +		int xLast = int(rc.right+0.5); +		int y = 0; +		surface->MoveTo(x, rc.top + y); +		while (x < xLast) { +			if ((x + 2) > xLast) { +				if (xLast > x) +					y = 1; +				x = xLast; +			} else { +				x += 2; +				y = 2 - y; +			}  			surface->LineTo(x, rc.top + y); -			x += 2; -			y = 2 - y;  		} -		surface->LineTo(rc.right, rc.top + y);	// Finish the line  	} else if (style == INDIC_SQUIGGLEPIXMAP) {  		PRectangle rcSquiggle = PixelGridAlign(rc); | 
