From aa380ed47a465e812e235e4c7a3706de905d4d2d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 21 Jan 2014 14:37:46 +0000 Subject: More scaled rendering improvements. Partial redraws of scaled textareas can't work atm, since neither the textarea nor content is aware of scale. --- desktop/textarea.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'desktop') diff --git a/desktop/textarea.c b/desktop/textarea.c index 0f0bd54e8..fa0b2fd05 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -2078,10 +2078,17 @@ void textarea_redraw(struct textarea *ta, int x, int y, colour bg, float scale, r = *clip; - if (r.x1 < x || r.x0 > x + ta->vis_width || r.y1 < y || - r.y0 > y + ta->vis_height) - /* Textarea outside the clipping rectangle */ + /* Nothing to render if textarea is outside clip rectangle */ + if (r.x1 < x || r.y1 < y) return; + if (scale == 1.0) { + if (r.x0 > x + ta->vis_width || r.y0 > y + ta->vis_height) + return; + } else { + if (r.x0 > x + ta->vis_width * scale || + r.y0 > y + ta->vis_height * scale) + return; + } if (ta->lines == NULL) /* Nothing to redraw */ @@ -2264,6 +2271,8 @@ void textarea_redraw(struct textarea *ta, int x, int y, colour bg, float scale, &right); } else { right = ta->lines[line].width; + if (scale != 1.0) + right *= scale; } right += x + ta->border_width + ta->pad_left - ta->scroll_x; -- cgit v1.2.3