diff options
author | nyamatongwe <devnull@localhost> | 2010-11-05 19:41:02 +1100 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2010-11-05 19:41:02 +1100 |
commit | 582553de962c49e01f595136906b5e9d14914ba1 (patch) | |
tree | 5143afab420c12881773b8df9eb3d8f3f750da14 | |
parent | db26221bb09b7bbbbc48f452803d7b8252a301e0 (diff) | |
download | scintilla-mirror-582553de962c49e01f595136906b5e9d14914ba1.tar.gz |
Change fold markers to connect better with Cairo drawing that
avoids last pixel with LineTo.
Changed RectangleDraw and Ellipse to align better with lines
and so match fold markers.
-rw-r--r-- | gtk/PlatGTK.cxx | 10 | ||||
-rw-r--r-- | src/LineMarker.cxx | 26 |
2 files changed, 18 insertions, 18 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 1139b1b97..a7c369cae 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -41,7 +41,7 @@ #endif #if GTK_CHECK_VERSION(2,22,0) -#define USE_CAIRO 1 +//#define USE_CAIRO 1 #endif #ifdef USE_CAIRO @@ -1088,8 +1088,8 @@ void SurfaceImpl::RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAlloc if (gc && drawable) { #endif #ifdef USE_CAIRO - cairo_rectangle(context, rc.left, rc.top, - rc.right - rc.left, rc.bottom - rc.top); + cairo_rectangle(context, rc.left + 0.5, rc.top + 0.5, + rc.right - rc.left - 1, rc.bottom - rc.top - 1); PenColour(back); cairo_fill_preserve(context); PenColour(fore); @@ -1297,8 +1297,8 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { PenColour(back); #ifdef USE_CAIRO - cairo_arc(context, (rc.left + rc.right) / 2, (rc.top + rc.bottom) / 2, - Platform::Minimum(rc.Width(), rc.Height()) / 2 - 1, 0, 2*M_PI); + cairo_arc(context, (rc.left + rc.right) / 2 + 0.5, (rc.top + rc.bottom) / 2 + 0.5, + Platform::Minimum(rc.Width(), rc.Height()) / 2, 0, 2*M_PI); cairo_fill_preserve(context); PenColour(fore); cairo_stroke(context); diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 41efe48ca..925bf5eb6 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -161,7 +161,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac } else if (markType == SC_MARK_VLINE) { surface->PenColour(back.allocated); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); } else if (markType == SC_MARK_LCORNER) { surface->PenColour(back.allocated); @@ -172,7 +172,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac } else if (markType == SC_MARK_TCORNER) { surface->PenColour(back.allocated); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); surface->MoveTo(centreX, rc.top + dimOn2); surface->LineTo(rc.right - 2, rc.top + dimOn2); @@ -186,7 +186,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac } else if (markType == SC_MARK_TCORNERCURVE) { surface->PenColour(back.allocated); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); surface->MoveTo(centreX, rc.top + dimOn2-3); surface->LineTo(centreX+3, rc.top + dimOn2); @@ -203,10 +203,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawPlus(surface, centreX, centreY, blobSize, back.allocated); surface->MoveTo(centreX, centreY + blobSize); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, centreY - blobSize); + surface->LineTo(centreX, centreY - blobSize + 1); } else if (markType == SC_MARK_BOXMINUS) { surface->PenColour(back.allocated); @@ -214,7 +214,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawMinus(surface, centreX, centreY, blobSize, back.allocated); surface->MoveTo(centreX, centreY + blobSize); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); } else if (markType == SC_MARK_BOXMINUSCONNECTED) { surface->PenColour(back.allocated); @@ -222,10 +222,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawMinus(surface, centreX, centreY, blobSize, back.allocated); surface->MoveTo(centreX, centreY + blobSize); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, centreY - blobSize); + surface->LineTo(centreX, centreY - blobSize + 1); } else if (markType == SC_MARK_CIRCLEPLUS) { DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, back.allocated); @@ -238,10 +238,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawPlus(surface, centreX, centreY, blobSize, back.allocated); surface->MoveTo(centreX, centreY + blobSize); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, centreY - blobSize); + surface->LineTo(centreX, centreY - blobSize + 1); } else if (markType == SC_MARK_CIRCLEMINUS) { DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, back.allocated); @@ -249,7 +249,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawMinus(surface, centreX, centreY, blobSize, back.allocated); surface->MoveTo(centreX, centreY + blobSize); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); } else if (markType == SC_MARK_CIRCLEMINUSCONNECTED) { DrawCircle(surface, centreX, centreY, blobSize, fore.allocated, back.allocated); @@ -257,10 +257,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawMinus(surface, centreX, centreY, blobSize, back.allocated); surface->MoveTo(centreX, centreY + blobSize); - surface->LineTo(centreX, rcWhole.bottom); + surface->LineTo(centreX, rcWhole.bottom + 1); surface->MoveTo(centreX, rcWhole.top); - surface->LineTo(centreX, centreY - blobSize); + surface->LineTo(centreX, centreY - blobSize + 1); } else if (markType >= SC_MARK_CHARACTER) { char character[1]; |