From f9ecd56f62f833f21b3475f0d1b59bc8e053a03e Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 8 Jul 2009 22:04:40 +0000 Subject: ploter refactor of rectangle handling svn path=/trunk/netsurf/; revision=8399 --- desktop/textarea.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'desktop/textarea.c') diff --git a/desktop/textarea.c b/desktop/textarea.c index 20aaeed78..520b53090 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -41,11 +41,17 @@ #define BORDER_COLOR 0x000000 #define SELECTION_COL 0xFFDDDD -static plot_style_t plot_style_fill_selection = { +static plot_style_t pstyle_fill_selection = { .fill_type = PLOT_OP_TYPE_SOLID, .fill_colour = SELECTION_COL, }; +static plot_style_t pstyle_stroke_border = { + .stroke_type = PLOT_OP_TYPE_SOLID, + .stroke_colour = BORDER_COLOR, + .stroke_width = 1, +}; + struct line_info { unsigned int b_start; /**< Byte offset of line start */ unsigned int b_length; /**< Byte length of line */ @@ -782,9 +788,10 @@ void textarea_redraw(struct text_area *ta, int x0, int y0, int x1, int y1) y1 = ta->y + ta->vis_height; plot.clip(x0, y0, x1, y1); - plot.fill(x0, y0, x1, y1, &plot_style_fill_bg); - plot.rectangle(ta->x, ta->y, ta->vis_width - 1, ta->vis_height - 1, 1, - BORDER_COLOR, false, false); + plot.rectangle(x0, y0, x1, y1, &plot_style_fill_bg); + plot.rectangle(ta->x, ta->y, + ta->x + ta->vis_width - 1, ta->y + ta->vis_height - 1, + &pstyle_stroke_border); if (x0 < ta->x + MARGIN_LEFT) x0 = ta->x + MARGIN_LEFT; @@ -864,13 +871,13 @@ void textarea_redraw(struct text_area *ta, int x0, int y0, int x1, int y1) b_start]), b_end, &x1); x1 += x0; - plot.fill(x0 - ta->scroll_x, ta->y + - line * ta->line_height - + 1 - ta->scroll_y, - x1 - ta->scroll_x, - ta->y + (line + 1) * ta->line_height - - 1 - ta->scroll_y, - &plot_style_fill_selection); + plot.rectangle(x0 - ta->scroll_x, ta->y + + line * ta->line_height + + 1 - ta->scroll_y, + x1 - ta->scroll_x, + ta->y + (line + 1) * ta->line_height - + 1 - ta->scroll_y, + &pstyle_fill_selection); } -- cgit v1.2.3