diff options
author | Neil <nyamatongwe@gmail.com> | 2015-07-14 13:00:14 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2015-07-14 13:00:14 +1000 |
commit | e85ed0e10fd79847e406f8552b00f2d6af7ac06c (patch) | |
tree | c26cae52a9a4594ee290388b9f8fb28abca8cd47 | |
parent | be850cc7139dbff5e72df7a2bea7d930715979ca (diff) | |
download | scintilla-mirror-e85ed0e10fd79847e406f8552b00f2d6af7ac06c.tar.gz |
Fix drawing problem when control characters are in a hidden style as they then
have a zero width rectangle to draw but modify that rectangle in a way that
clears some pixels.
-rw-r--r-- | doc/ScintillaHistory.html | 5 | ||||
-rw-r--r-- | src/EditView.cxx | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 164a1c317..773a376bf 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -526,6 +526,11 @@ <a href="http://sourceforge.net/p/scintilla/bugs/1740/">Bug #1740</a>. </li> <li> + Fix drawing problem when control characters are in a hidden style as they then + have a zero width rectangle to draw but modify that rectangle in a way that + clears some pixels. + </li> + <li> Report error when attempt to resize buffer to more than 2GB with SC_STATUS_FAILURE. </li> <li> diff --git a/src/EditView.cxx b/src/EditView.cxx index e6963e56a..43c3f842b 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -772,6 +772,8 @@ static void SimpleAlphaRectangle(Surface *surface, PRectangle rc, ColourDesired static void DrawTextBlob(Surface *surface, const ViewStyle &vsDraw, PRectangle rcSegment, const char *s, ColourDesired textBack, ColourDesired textFore, bool fillBackground) { + if (rcSegment.Empty()) + return; if (fillBackground) { surface->FillRectangle(rcSegment, textBack); } @@ -1284,7 +1286,7 @@ void EditView::DrawBackground(Surface *surface, const EditModel &model, const Vi rcSegment.right = ll->positions[ts.end()] + xStart - static_cast<XYPOSITION>(subLineStart); // Only try to draw if really visible - enhances performance by not calling environment to // draw strings that are completely past the right side of the window. - if (rcSegment.Intersects(rcLine)) { + if (!rcSegment.Empty() && rcSegment.Intersects(rcLine)) { // Clip to line rectangle, since may have a huge position which will not work with some platforms if (rcSegment.left < rcLine.left) rcSegment.left = rcLine.left; |