From 6f9898950d38a9943c97bc7575871af88b095e3c Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 23 Jan 2004 16:56:57 +0000 Subject: [project @ 2004-01-23 16:56:57 by bursa] Fix positioning of drawfiles (render bounding box). svn path=/import/netsurf/; revision=495 --- riscos/draw.c | 7 +++++-- riscos/draw.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'riscos') 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); diff --git a/riscos/draw.h b/riscos/draw.h index e16734b97..6fdf0a3c1 100644 --- a/riscos/draw.h +++ b/riscos/draw.h @@ -13,6 +13,7 @@ struct content; struct content_draw_data { void *data; unsigned long length; + int x0, y0; }; void draw_init(void); -- cgit v1.2.3