[gtk+] Rotate number-up layout according to orientation when printing



commit 50e784c40519288d688f2dab8a84a05569e0a2ad
Author: Marek Kasik <mkasik redhat com>
Date:   Tue Oct 27 16:53:43 2009 +0100

    Rotate number-up layout according to orientation when printing
    
    Number-up layout has to be rotated differently since rotation in
    "landscape" and "reversed landscape" mode was changed.

 modules/printbackends/cups/gtkprintbackendcups.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
index 7fd3984..10947b4 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
@@ -4319,18 +4319,18 @@ cups_printer_prepare_for_print (GtkPrinter       *printer,
             break;
           case GTK_PAGE_ORIENTATION_LANDSCAPE:
             if (layout < 4)
-              layout = layout + 5 - 2 * (layout % 2);
+              layout = layout + 2 + 4 * (1 - layout / 2);
             else
-              layout = layout - 6 + 4 * (1 - (layout - 4) / 2);
+              layout = layout - 3 - 2 * (layout % 2);
             break;
           case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
             layout = (layout + 3 - 2 * (layout % 2)) % 4 + 4 * (layout / 4);
             break;
           case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
             if (layout < 4)
-              layout = layout + 2 + 4 * (1 - layout / 2);
+              layout = layout + 5 - 2 * (layout % 2);
             else
-              layout = layout - 3 - 2 * (layout % 2);
+              layout = layout - 6 + 4 * (1 - (layout - 4) / 2);
             break;
         }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]