diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-01-12 01:12:28 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-01-12 01:12:28 +0100 |
commit | 9994b3f49db7bd925a7ae7874cbc99025469ee9e (patch) | |
tree | c718919738e0c70cc94959aad1b5b4997f11389f /apps/xpsdraw.c | |
parent | 09086b236af6e49f2f090f80a450b1d82f217f30 (diff) | |
download | mupdf-9994b3f49db7bd925a7ae7874cbc99025469ee9e.tar.xz |
Use the same coordinate system for pdf and xps pages in the interface.
Move coordinate space tweaks into pdf_ and xps_run_page, and provide
neutral pdf_ and xps_bound_page functions to return the page size as
a zero-origined bounding box.
Diffstat (limited to 'apps/xpsdraw.c')
-rw-r--r-- | apps/xpsdraw.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/xpsdraw.c b/apps/xpsdraw.c index 1058c390..50a2c3e3 100644 --- a/apps/xpsdraw.c +++ b/apps/xpsdraw.c @@ -137,13 +137,9 @@ static void drawpage(xps_document *doc, int pagenum) fz_bbox bbox; fz_pixmap *pix; - rect.x0 = rect.y0 = 0; - rect.x1 = page->width; - rect.y1 = page->height; - - zoom = resolution / 96; - ctm = fz_translate(0, -page->height); - ctm = fz_concat(ctm, fz_scale(zoom, zoom)); + rect = xps_bound_page(doc, page); + zoom = resolution / 72; + ctm = fz_scale(zoom, zoom); bbox = fz_round_rect(fz_transform_rect(ctm, rect)); /* TODO: banded rendering and multi-page ppm */ |