From: John Darrington Date: Sun, 20 Jan 2013 11:49:54 +0000 (+0100) Subject: Fix xr to point unit conversion in cairo output driver. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba075ea761f61f0491422a555de568adc4891563;p=pspp Fix xr to point unit conversion in cairo output driver. The conversion between points (1/72") and xr units was wrong. This meant that some things were slightly the wrong size. Reviewed-by: Ben Pfaff --- diff --git a/src/output/cairo.c b/src/output/cairo.c index 776f7f5de8..32586f7937 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -66,8 +66,7 @@ #define V TABLE_VERT /* Measurements as we present to the rest of PSPP. */ -#define XR_POINT PANGO_SCALE -#define XR_INCH (XR_POINT * 72) +#define XR_POINT 1000 /* Conversions to and from points. */ static double @@ -1016,8 +1015,8 @@ xr_rendering_measure (struct xr_rendering *r, int *w, int *h) { int w0 = render_page_get_size (r->page, H); int w1 = r->title_width; - *w = MAX (w0, w1) / 1024; - *h = (render_page_get_size (r->page, V) + r->title_height) / 1024; + *w = MAX (w0, w1) / XR_POINT; + *h = (render_page_get_size (r->page, V) + r->title_height) / XR_POINT; } else { @@ -1049,8 +1048,9 @@ xr_rendering_draw (struct xr_rendering *r, cairo_t *cr, } xr->y = r->title_height; - render_page_draw_region (r->page, x * 1024, (y * 1024) - r->title_height, - w * 1024, h * 1024); + render_page_draw_region (r->page, + x * XR_POINT, (y * XR_POINT) - r->title_height, + w * XR_POINT, h * XR_POINT); } else xr_draw_chart (to_chart_item (r->item), cr,