[evince] printing: Fix centering when shrinking to printable area but not scaling



commit 4df4afe90c902652a84d16e1735105960a649145
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Mon May 12 11:13:16 2014 +0200

    printing: Fix centering when shrinking to printable area but not scaling
    
    When shrinking to printable area is selected and we don't need to scale
    because the document fits in the printable area, the document is
    centered applying the current scale. Since we are not going to scale in
    that case, we should ignore any scale value > 1 when shrinking to
    printable area.

 libview/ev-print-operation.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c
index ea31836..8d5aa39 100644
--- a/libview/ev-print-operation.c
+++ b/libview/ev-print-operation.c
@@ -1868,11 +1868,11 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print,
 
                x_scale = (cr_width - left - right) / width;
                y_scale = (cr_height - top - bottom) / height;
+                scale = MIN (x_scale, y_scale);
 
-               if (x_scale < y_scale)
-                       scale = x_scale;
-               else
-                       scale = y_scale;
+                /* Ignore scale > 1 when shrinking to printable area */
+                if (scale > 1.0 && print->page_scale == EV_SCALE_SHRINK_TO_PRINTABLE_AREA)
+                        scale = 1.0;
 
                if (print->autorotate) {
                        double left_right_sides, top_bottom_sides;


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