From ddb92b7c3fdfcf9bf3d7463dde4e662ca10f79ba Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 25 Jan 2013 14:07:29 +0100 Subject: Eliminate fz_bbox in favor of fz_rect everywhere. --- doc/example.c | 5 ++--- doc/multi-threaded.c | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/example.c b/doc/example.c index 9ffe7023..b834e3ff 100644 --- a/doc/example.c +++ b/doc/example.c @@ -41,9 +41,8 @@ render(char *filename, int pagenumber, int zoom, int rotation) // Take the page bounds and transform them by the same matrix that // we will use to render the page. - fz_rect rect = fz_bound_page(doc, page); - rect = fz_transform_rect(transform, rect); - fz_bbox bbox = fz_round_rect(rect); + fz_rect bbox = fz_bound_page(doc, page); + bbox = fz_transform_rect(transform, rect); // Create a blank pixmap to hold the result of rendering. The // pixmap bounds used here are the same as the transformed page diff --git a/doc/multi-threaded.c b/doc/multi-threaded.c index 68cd568d..b54beb81 100644 --- a/doc/multi-threaded.c +++ b/doc/multi-threaded.c @@ -58,7 +58,7 @@ struct data { // The area of the page to render as obtained by the main // thread and sent from main to rendering thread. - fz_bbox bbox; + fz_rect bbox; // This is the result, a pixmap containing the rendered page. // It is passed first from main thread to the rendering @@ -79,7 +79,7 @@ renderer(void *data) int pagenumber = ((struct data *) data)->pagenumber; fz_context *ctx = ((struct data *) data)->ctx; fz_display_list *list = ((struct data *) data)->list; - fz_bbox bbox = ((struct data *) data)->bbox; + fz_rect bbox = ((struct data *) data)->bbox; fz_pixmap *pix = ((struct data *) data)->pix; fprintf(stderr, "thread at page %d loading!\n", pagenumber); @@ -180,8 +180,7 @@ int main(int argc, char **argv) // Compute the bounding box for each page. - fz_rect rect = fz_bound_page(doc, page); - fz_bbox bbox = fz_round_rect(rect); + fz_rect bbox = fz_bound_page(doc, page); // Create a display list that will hold the drawing // commands for the page. @@ -202,8 +201,7 @@ int main(int argc, char **argv) // Create a white pixmap using the correct dimensions. - fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, - fz_device_rgb, bbox); + fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox); fz_clear_pixmap_with_value(ctx, pix, 0xff); // Populate the data structure to be sent to the -- cgit v1.2.3