aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2015-07-14 13:00:14 +1000
committerNeil <nyamatongwe@gmail.com>2015-07-14 13:00:14 +1000
commite85ed0e10fd79847e406f8552b00f2d6af7ac06c (patch)
treec26cae52a9a4594ee290388b9f8fb28abca8cd47 /src/EditView.cxx
parentbe850cc7139dbff5e72df7a2bea7d930715979ca (diff)
downloadscintilla-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.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx4
1 files changed, 3 insertions, 1 deletions
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;