summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-03-17 18:49:25 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-03-17 18:49:25 +0000
commitad2116a730fa656773232e2ed3b4840a0b398724 (patch)
treeba0a18edb69b90a3494442b12812dfecf7912c57
parentff600fbf8c08adf3b98869fab89529cc005b493c (diff)
downloadnetsurf-ad2116a730fa656773232e2ed3b4840a0b398724.tar.gz
netsurf-ad2116a730fa656773232e2ed3b4840a0b398724.tar.bz2
Handle scaled rendering of text/plain with plot origin offset too.
svn path=/trunk/netsurf/; revision=12098
-rw-r--r--render/textplain.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/render/textplain.c b/render/textplain.c
index 8514b43ef..9601e25ab 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -557,8 +557,8 @@ bool textplain_redraw(struct content *c, int x, int y,
unsigned long line_count = c->data.textplain.physical_line_count;
float line_height = textplain_line_height();
float scaled_line_height = line_height * scale;
- long line0 = (clip->y0 - y) / scaled_line_height - 1;
- long line1 = (clip->y1 - y) / scaled_line_height + 1;
+ long line0 = (clip->y0 - y * scale) / scaled_line_height - 1;
+ long line1 = (clip->y1 - y * scale) / scaled_line_height + 1;
struct textplain_line *line = c->data.textplain.physical_line;
size_t length;
plot_style_t *plot_style_highlight;
@@ -590,8 +590,8 @@ bool textplain_redraw(struct content *c, int x, int y,
/* Set up font plot style */
textplain_style.background = background_colour;
- x += MARGIN * scale;
- y += MARGIN * scale;
+ x = (x + MARGIN) * scale;
+ y = (y + MARGIN) * scale;
for (lineno = line0; lineno != line1; lineno++) {
const char *text = utf8_data + line[lineno].start;
int tab_width = textplain_tab_width * scale;