aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-06-26 10:59:08 +1000
committernyamatongwe <devnull@localhost>2012-06-26 10:59:08 +1000
commit8ae6a4660ac6b602b7399977e4d908d7640a2325 (patch)
tree929408b3033fcf6e246286564bc6260d48f4f94d /src
parent96f05dcfd4c44567f6efaf19ab7d6bcad086ca20 (diff)
downloadscintilla-mirror-8ae6a4660ac6b602b7399977e4d908d7640a2325.tar.gz
Bugs #699587, #3537799. Allow text at start of line to overlap 1 pixel
into the margin as this displays serifs and italic stems for aliased text.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c424cd278..20209ed98 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3523,10 +3523,16 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
rcTextArea.left = vs.fixedColumnWidth;
rcTextArea.right -= vs.rightMarginWidth;
+ // Allow text at start of line to overlap 1 pixel into the margin as this displays
+ // serifs and italic stems for aliased text.
+ const int leftTextOverlap = ((xOffset == 0) && (vs.rightMarginWidth > 0)) ? 1 : 0;
+
// Remove selection margin from drawing area so text will not be drawn
// on it in unbuffered mode.
if (!bufferedDraw) {
- surfaceWindow->SetClip(rcTextArea);
+ PRectangle rcClipText = rcTextArea;
+ rcClipText.left -= leftTextOverlap;
+ surfaceWindow->SetClip(rcClipText);
}
// Loop on visible lines
@@ -3577,6 +3583,13 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
ll->SetBracesHighlight(rangeLine, braces, static_cast<char>(bracesMatchStyle),
highlightGuideColumn * vs.spaceWidth, bracesIgnoreStyle);
+ if (leftTextOverlap && bufferedDraw) {
+ PRectangle rcSpacer = rcLine;
+ rcSpacer.right = rcSpacer.left;
+ rcSpacer.left -= 1;
+ surface->FillRectangle(rcSpacer, vs.styles[STYLE_DEFAULT].back);
+ }
+
// Draw the line
DrawLine(surface, vs, lineDoc, visibleLine, xStart, rcLine, ll, subLine);
//durPaint += et.Duration(true);
@@ -3610,8 +3623,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
DrawCarets(surface, vs, lineDoc, xStart, rcLine, ll, subLine);
if (bufferedDraw) {
- Point from(vs.fixedColumnWidth, 0);
- PRectangle rcCopyArea(vs.fixedColumnWidth, yposScreen,
+ Point from(vs.fixedColumnWidth-leftTextOverlap, 0);
+ PRectangle rcCopyArea(vs.fixedColumnWidth-leftTextOverlap, yposScreen,
rcClient.right - vs.rightMarginWidth, yposScreen + vs.lineHeight);
surfaceWindow->Copy(rcCopyArea, from, *pixmapLine);
}