diff options
author | James Bursa <james@netsurf-browser.org> | 2004-01-23 16:56:57 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-01-23 16:56:57 +0000 |
commit | 6f9898950d38a9943c97bc7575871af88b095e3c (patch) | |
tree | 6d87278467aed5bd5d412ad76642270a7a21e896 /riscos/draw.c | |
parent | 1e0630b29032cf56541e8f9f207063b68217a499 (diff) | |
download | netsurf-6f9898950d38a9943c97bc7575871af88b095e3c.tar.gz netsurf-6f9898950d38a9943c97bc7575871af88b095e3c.tar.bz2 |
[project @ 2004-01-23 16:56:57 by bursa]
Fix positioning of drawfiles (render bounding box).
svn path=/import/netsurf/; revision=495
Diffstat (limited to 'riscos/draw.c')
-rw-r--r-- | riscos/draw.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/riscos/draw.c b/riscos/draw.c index 96b63b2b2..3eaf63087 100644 --- a/riscos/draw.c +++ b/riscos/draw.c @@ -61,6 +61,8 @@ int draw_convert(struct content *c, unsigned int width, unsigned int height) => divide by 512 to convert from draw units */ c->width = ((bbox->x1 - bbox->x0) / 512); c->height = ((bbox->y1 - bbox->y0) / 512); + c->data.draw.x0 = bbox->x0 / 2; + c->data.draw.y0 = bbox->y0 / 2; c->title = xcalloc(100, 1); sprintf(c->title, "Draw image (%lux%lu, %lu bytes)", c->width, c->height, c->data.draw.length); @@ -100,8 +102,9 @@ void draw_redraw(struct content *c, long x, long y, matrix->entries[1][0] = 0; matrix->entries[1][1] = ((height*65536) / (c->height*2)); /* Draw units. (x,y) = bottom left */ - matrix->entries[2][0] = x * 256; - matrix->entries[2][1] = (y-height) * 256; + matrix->entries[2][0] = x * 256 - c->data.draw.x0 * width / c->width; + matrix->entries[2][1] = (y - height) * 256 - + c->data.draw.y0 * height / c->height; xdrawfile_render(0, (drawfile_diagram*)(c->data.draw.data), (int)c->data.draw.length, matrix, 0, 0); |