From 50efd110b8cbca87cc3c5c6065b2e498301c04c6 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 20 Mar 2013 18:09:52 +0000 Subject: Use cached line length to avoid some nsfont_width calls for selection rendering in redraw. --- desktop/textarea.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'desktop/textarea.c') diff --git a/desktop/textarea.c b/desktop/textarea.c index d3a848fa0..03f8912ff 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -1860,16 +1860,14 @@ void textarea_redraw(struct textarea *ta, int x, int y, colour bg, float scale, /* find clip left/right for this part of line */ left = right; - if (b_len_part != b_len || selected) { + if (b_len_part != b_len) { nsfont.font_width(&fstyle, line_text, b_end, &right); - right += x + ta->border_width + ta->pad_left - - ta->scroll_x; } else { - right = x + ta->vis_width - ta->border_width - - (ta->bar_y != NULL ? - SCROLLBAR_WIDTH : 0); + right = ta->lines[line].width; } + right += x + ta->border_width + ta->pad_left - + ta->scroll_x; /* set clip rectangle for line part */ s = r; -- cgit v1.2.3