More scaled rendering improvements. Partial redraws of scaled textareas can't work atm, since neither the textarea nor content is aware of scale.

This commit is contained in:
Michael Drake 2014-01-21 14:37:46 +00:00
parent 3f3b64bf22
commit aa380ed47a

View File

@ -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;