summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-03-20 18:09:52 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-03-20 18:09:52 +0000
commit50efd110b8cbca87cc3c5c6065b2e498301c04c6 (patch)
tree420d9043b4375e2dae1aa2e83189adf0c1c49825
parent3403891f63dd8842bfac48626e3ccb569893aa21 (diff)
downloadnetsurf-50efd110b8cbca87cc3c5c6065b2e498301c04c6.tar.gz
netsurf-50efd110b8cbca87cc3c5c6065b2e498301c04c6.tar.bz2
Use cached line length to avoid some nsfont_width calls for selection rendering in redraw.
-rw-r--r--desktop/textarea.c10
1 files changed, 4 insertions, 6 deletions
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;