From 2b92bd4dbb082cab75e5c9e74efe50ec9f589983 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 12 Sep 2005 01:07:34 +0000 Subject: [PATCH] (redraw): Don't redraw an area where not text is displayed. --- example/medit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/example/medit.c b/example/medit.c index 9cff321..cf7aa7c 100644 --- a/example/medit.c +++ b/example/medit.c @@ -391,12 +391,17 @@ redraw (int y0, int y1, int clear, int scroll_bar) info.metrics.height = line->y1 - y; info.metrics.y = - line->ascent; info.line_to = line->to; - while (from < nchars && y + info.metrics.height <= y0) + while (y + info.metrics.height <= y0) { y += info.metrics.height; from = info.line_to; + if (from >= nchars) + break; GLYPH_INFO (from, from, info); } + if (y + info.metrics.height <= y0) + return; + y0 = y - info.metrics.y; to = from; while (to < nchars && y < y1) -- 1.7.10.4