diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-21 14:37:46 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-01-21 14:37:46 +0000 |
commit | aa380ed47a465e812e235e4c7a3706de905d4d2d (patch) | |
tree | 43d310c68d8daa8ea1cfde8bf6bef79a4de57214 | |
parent | 3f3b64bf222975546498b9db28e962cf99fb88f1 (diff) | |
download | netsurf-aa380ed47a465e812e235e4c7a3706de905d4d2d.tar.gz netsurf-aa380ed47a465e812e235e4c7a3706de905d4d2d.tar.bz2 |
More scaled rendering improvements. Partial redraws of scaled textareas can't work atm, since neither the textarea nor content is aware of scale.
-rw-r--r-- | desktop/textarea.c | 15 |
1 files changed, 12 insertions, 3 deletions
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; |