From fe043bf731ba355902f5d15934ba0597f44c0bc2 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 27 Jun 2012 15:52:03 +0000 Subject: [PATCH] Bug #631611 - Check printing fails because fonts are too tiny on Windows Lesson learned: don't use cairo_identity_matrix on a cairo_t managed by GtkPrintContext. It kills a number of transformations that were already configured by GtkPrintContext. On Windows this breaks proper scaling. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22243 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome/dialog-print-check.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c index 2489aeecfc..68ce549bcf 100644 --- a/src/gnome/dialog-print-check.c +++ b/src/gnome/dialog-print-check.c @@ -2271,7 +2271,6 @@ draw_check_format(GtkPrintContext *context, gint position, gdouble x, y, r, multip; cr = gtk_print_context_get_cairo_context(context); - cairo_identity_matrix(cr); cairo_translate(cr, format->trans_x, format->trans_y); g_debug("Page translated by %f,%f", format->trans_x, format->trans_y); cairo_rotate(cr, format->rotation * DEGREES_TO_RADIANS); @@ -2286,15 +2285,19 @@ draw_check_format(GtkPrintContext *context, gint position, pcd->default_font); } - /* Translate all subsequent check items if requested. */ - if ((position >= 0) && (position < pcd->position_max)) + /* Translate all subsequent check items if requested. + * For check position 0, no translation is needed. */ + if ((position > 0) && (position < pcd->position_max)) { - y = format->height * position; - cairo_translate(cr, 0, y); - g_debug("Position translated by %f (pre-defined)", y); + /* Standard positioning is used. + * Note that the first check on the page (position 0) doesn't + * need to be moved (hence the test for position > 0 above. */ + cairo_translate(cr, 0, format->height); + g_debug("Position %d translated by %f (pre-defined)", position, format->height); } - else + else if (position == pcd->position_max) { + /* Custom positioning is used. */ multip = pcd_get_custom_multip(pcd); x = multip * gtk_spin_button_get_value(pcd->translation_x); y = multip * gtk_spin_button_get_value(pcd->translation_y);