[geany/geany] 4423de: Printing: fix improper margins when printing to a physical device

Colomban Wendling git-noreply at geany.org
Tue Jan 1 18:21:30 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Fri, 02 Nov 2012 20:48:49 UTC
Commit:      4423de1a7223bc85ea89d706e699d2344d8dd36a
             https://github.com/geany/geany/commit/4423de1a7223bc85ea89d706e699d2344d8dd36a

Log Message:
-----------
Printing: fix improper margins when printing to a physical device

We were improperly adding the printing device margins to the area
where we print, leading to wider margins on physical outputs than
on PDF or preview outputs (which have no hard margins), as well as
wasting space and not respecting user's settings.

Closes #3580269.


Modified Paths:
--------------
    src/printing.c

Modified: src/printing.c
13 files changed, 1 insertions(+), 12 deletions(-)
===================================================================
@@ -309,18 +309,7 @@ static void setup_range(DocInfo *dinfo, GtkPrintContext *ctx)
 	dinfo->fr.rc.top    = dinfo->fr.rcPage.top;
 	dinfo->fr.rc.right  = dinfo->fr.rcPage.right;
 	dinfo->fr.rc.bottom = dinfo->fr.rcPage.bottom;
-#if GTK_CHECK_VERSION(2, 20, 0)
-	{
-		gdouble m_top, m_left, m_right, m_bottom;
-		if (gtk_print_context_get_hard_margins(ctx, &m_top, &m_bottom, &m_left, &m_right))
-		{
-			dinfo->fr.rc.left   += m_left;
-			dinfo->fr.rc.top    += m_top;
-			dinfo->fr.rc.right  -= m_right;
-			dinfo->fr.rc.bottom -= m_bottom;
-		}
-	}
-#endif
+
 	if (printing_prefs.print_page_header)
 		dinfo->fr.rc.top += dinfo->line_height * 3; /* header height */
 	if (printing_prefs.print_page_numbers)



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list