aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-08-05 17:40:47 +1000
committernyamatongwe <devnull@localhost>2012-08-05 17:40:47 +1000
commit6812414a55571b3157ac0857fc25e1a6d4b8402a (patch)
treee988bf9ae0796b629bbcffca7cbeef5800f58ae8 /src
parentc5506609e3e407d7fa578f9075d70b613d50a8bc (diff)
downloadscintilla-mirror-6812414a55571b3157ac0857fc25e1a6d4b8402a.tar.gz
Avoid poor drawing at right of INDIC_SQUIGGLE.
Diffstat (limited to 'src')
-rw-r--r--src/Indicator.cxx20
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);