r22244 - gnucash/branches/2.4/src/gnome - Bug #631611 - Check printing fails because fonts are too tiny on Windows
Geert Janssens
gjanssens at code.gnucash.org
Wed Jun 27 12:02:44 EDT 2012
Author: gjanssens
Date: 2012-06-27 12:02:44 -0400 (Wed, 27 Jun 2012)
New Revision: 22244
Trac: http://svn.gnucash.org/trac/changeset/22244
Modified:
gnucash/branches/2.4/src/gnome/dialog-print-check.c
Log:
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.
Modified: gnucash/branches/2.4/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/branches/2.4/src/gnome/dialog-print-check.c 2012-06-27 15:52:03 UTC (rev 22243)
+++ gnucash/branches/2.4/src/gnome/dialog-print-check.c 2012-06-27 16:02:44 UTC (rev 22244)
@@ -2200,7 +2200,6 @@
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);
@@ -2215,15 +2214,19 @@
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);
More information about the gnucash-changes
mailing list