From: handa Date: Mon, 12 Sep 2005 01:07:34 +0000 (+0000) Subject: (redraw): Don't redraw an area where not text is X-Git-Tag: REL-1-3-0~176 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2b92bd4dbb082cab75e5c9e74efe50ec9f589983;p=m17n%2Fm17n-lib.git (redraw): Don't redraw an area where not text is displayed. --- 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)