aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
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;