]> Pileus Git - ~andy/gtk/commitdiff
Correct the orientation of landscape pages
authorAdrian Johnson <ajohnson@redneon.com>
Wed, 30 Sep 2009 16:47:55 +0000 (12:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 30 Sep 2009 16:47:55 +0000 (12:47 -0400)
The convention for landscape pages, and required by PostScript
Language Reference Manual, is for landscape printing to rotate user
space 90 degrees counterclockwise. Part of bug 596423

gtk/gtkprintcontext.c

index c280881f80c0c091e53cb3f7a98d69ac936992f9..80eac79fa75424c85f7ddeae19428633a4acf55e 100644 (file)
@@ -177,11 +177,11 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
     case GTK_PAGE_ORIENTATION_PORTRAIT:
       break;
     case GTK_PAGE_ORIENTATION_LANDSCAPE:
-      cairo_translate (cr, width, 0);
+      cairo_translate (cr, 0, height);
       cairo_matrix_init (&matrix,
-                         0,  1,
-                        -1,  0,
-                         0,  0);
+                        0, -1,
+                        1,  0,
+                        0,  0);
       cairo_transform (cr, &matrix);
       break;
     case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
@@ -193,11 +193,11 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
       cairo_transform (cr, &matrix);
       break;
     case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
-      cairo_translate (cr, 0, height);
+      cairo_translate (cr, width, 0);
       cairo_matrix_init (&matrix,
-                        0, -1,
-                        1,  0,
-                        0,  0);
+                         0,  1,
+                        -1,  0,
+                         0,  0);
       cairo_transform (cr, &matrix);
       break;
     }