diff options
author | nyamatongwe <unknown> | 2011-11-30 17:10:33 +1100 |
---|---|---|
committer | nyamatongwe <unknown> | 2011-11-30 17:10:33 +1100 |
commit | 255948938cfb95f472c494f6d66fd08175eb4064 (patch) | |
tree | a7eb34ea8f0762ed297629d18dae8e7641997e59 /src/Editor.cxx | |
parent | 1e5e7dc3c7d21f21293fcd6612e0e1520d22594b (diff) | |
download | scintilla-mirror-255948938cfb95f472c494f6d66fd08175eb4064.tar.gz |
Clip margin drawing to the paint area.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 8c939fdb1..66103fc93 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1761,6 +1761,12 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { surface = surfWindow; } + // Clip vertically to paint area to avoid drawing line numbers + if (rcMargin.bottom > rc.bottom) + rcMargin.bottom = rc.bottom; + if (rcMargin.top < rc.top) + rcMargin.top = rc.top; + PRectangle rcSelMargin = rcMargin; rcSelMargin.right = rcMargin.left; @@ -1793,8 +1799,9 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { surface->FillRectangle(rcSelMargin, vs.styles[STYLE_LINENUMBER].back); } - int visibleLine = topLine; - int yposScreen = 0; + const int lineStartPaint = rcMargin.top / vs.lineHeight; + int visibleLine = topLine + lineStartPaint; + int yposScreen = lineStartPaint * vs.lineHeight; // Work out whether the top line is whitespace located after a // lessening of fold level which implies a 'fold tail' but which should not // be displayed until the last of a sequence of whitespace. |