diff options
author | nyamatongwe <unknown> | 2012-06-26 10:59:08 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2012-06-26 10:59:08 +1000 |
commit | c75c3b29f9047a9b1bb0cdf7ea7d0f6336cd63ee (patch) | |
tree | 5bbd6f965467596c75e2bfa35492ea4f39db601d /src/Editor.cxx | |
parent | ab81f49b0bab3a161a71b29c0d063222039cc095 (diff) | |
download | scintilla-mirror-c75c3b29f9047a9b1bb0cdf7ea7d0f6336cd63ee.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/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 19 |
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); } |