X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fcairo.c;h=e29e6583c5f63a74fa9bc6b75d70125d09073098;hb=5f9212b9af772575bd3026ca9643684ce6493b3c;hp=19a3678cc1f0d45dfda22a136b5c53ead1ac56b5;hpb=8b37f66b3599f5809fbbb300d5cba5bb0557c184;p=pspp diff --git a/src/output/cairo.c b/src/output/cairo.c index 19a3678cc1..e29e6583c5 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -65,8 +65,8 @@ #define H TABLE_HORZ #define V TABLE_VERT -/* Measurements as we present to the rest of PSPP. */ -#define XR_POINT 1000 +/* The unit used for internal measurements is inch/(72 * XR_POINT). */ +#define XR_POINT PANGO_SCALE /* Conversions to and from points. */ static double @@ -315,13 +315,17 @@ xr_allocate (const char *name, int device_type, struct string_map *o) static int pango_to_xr (int pango) { - return ceil (pango * (1. * XR_POINT / PANGO_SCALE)); + return (XR_POINT != PANGO_SCALE + ? ceil (pango * (1. * XR_POINT / PANGO_SCALE)) + : pango); } static int xr_to_pango (int xr) { - return ceil (xr * (1. / XR_POINT * PANGO_SCALE)); + return (XR_POINT != PANGO_SCALE + ? ceil (xr * (1. / XR_POINT * PANGO_SCALE)) + : xr); } static bool