From 99cab8389af03d5ca447d79b3a01885b1c22744a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 11 Feb 2013 17:05:42 +0000 Subject: Early detection of regions outside the visible. --- desktop/textarea.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'desktop') diff --git a/desktop/textarea.c b/desktop/textarea.c index eedc09115..61d21ccea 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -1600,6 +1600,15 @@ void textarea_redraw(struct textarea *ta, int x, int y, colour bg, float scale, /* set clip rectangle for line part */ s = r; + + if (s.x1 < left || s.x0 > right) { + /* Skip this span, it's outside the visible */ + c_pos += c_len_part; + c_len -= c_len_part; + continue; + } + + /* Adjust clip rectangle to span limits */ if (s.x0 < left) s.x0 = left; if (s.x1 > right) -- cgit v1.2.3