From c3451b0616605200f1954fbee68adf510d8ac5cc Mon Sep 17 00:00:00 2001 From: mkasik Date: Oct 29 2009 14:25:39 +0000 Subject: - Add backported patch evince-aspect-ratio.patch (#531430). - Preserve aspect ratio of scaled pages and set page orientation - automatically (gnome bugs #599468 and #599470) --- diff --git a/evince-aspect-ratio.patch b/evince-aspect-ratio.patch new file mode 100644 index 0000000..2eedc07 --- /dev/null +++ b/evince-aspect-ratio.patch @@ -0,0 +1,63 @@ +--- shell/ev-print-operation.c.aspect-ratio 2009-10-29 15:01:28.000000000 +0100 ++++ shell/ev-print-operation.c 2009-10-29 15:01:40.000000000 +0100 +@@ -1638,13 +1638,36 @@ print_job_cancelled (EvJobPrint + } + + static void ++ev_print_operation_print_request_page_setup (EvPrintOperationPrint *print, ++ GtkPrintContext *context, ++ gint page_nr, ++ GtkPageSetup *setup) ++{ ++ EvPrintOperation *op = EV_PRINT_OPERATION (print); ++ gdouble width, height; ++ EvPage *page; ++ ++ page = ev_document_get_page (op->document, page_nr); ++ ++ ev_document_get_page_size (op->document, page, ++ &width, &height); ++ ++ if (width > height) ++ gtk_page_setup_set_orientation (setup, GTK_PAGE_ORIENTATION_LANDSCAPE); ++ else ++ gtk_page_setup_set_orientation (setup, GTK_PAGE_ORIENTATION_PORTRAIT); ++ ++ g_object_unref (page); ++} ++ ++static void + ev_print_operation_print_draw_page (EvPrintOperationPrint *print, + GtkPrintContext *context, + gint page) + { + EvPrintOperation *op = EV_PRINT_OPERATION (print); + cairo_t *cr; +- gdouble cr_width, cr_height; ++ gdouble cr_width, cr_height, scale; + gint width, height; + + gtk_print_operation_set_defer_drawing (print->op); +@@ -1667,7 +1690,11 @@ ev_print_operation_print_draw_page (EvPr + ev_page_cache_get_size (ev_page_cache_get (op->document), + page, 0, 1.0, + &width, &height); +- cairo_scale (cr, cr_width / (gdouble)width, cr_height / (gdouble)height); ++ if (cr_width / (gdouble)width < cr_height / (gdouble)height) ++ scale = cr_width / (gdouble)width; ++ else ++ scale = cr_height / (gdouble)height; ++ cairo_scale (cr, scale, scale); + + ev_job_print_set_cairo (EV_JOB_PRINT (print->job_print), cr); + ev_job_scheduler_push_job (print->job_print, EV_JOB_PRIORITY_NONE); +@@ -1720,6 +1747,9 @@ ev_print_operation_print_init (EvPrintOp + g_signal_connect_swapped (print->op, "status_changed", + G_CALLBACK (ev_print_operation_print_status_changed), + print); ++ g_signal_connect_swapped (print->op, "request_page_setup", ++ G_CALLBACK (ev_print_operation_print_request_page_setup), ++ print); + gtk_print_operation_set_allow_async (print->op, TRUE); + } + diff --git a/evince.spec b/evince.spec index 78996da..d9d4340 100644 --- a/evince.spec +++ b/evince.spec @@ -6,7 +6,7 @@ Name: evince Version: 2.28.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Document viewer License: GPLv2+ and GFDL @@ -22,6 +22,8 @@ Patch1: 0001-Provide-some-indication-that-search-is-not-available.patch Patch2: evince-thumbnail-allocation.patch # https://bugzilla.gnome.org/show_bug.cgi?id=599726 Patch3: seriesid-clash.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=531430 +Patch4: evince-aspect-ratio.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -115,6 +117,7 @@ This package contains a backend to let evince display djvu files. %patch1 -p1 -b .search-not-available %patch2 -p0 -b .thumbnail-allocation %patch3 -p1 -b .seriesid +%patch4 -p0 -b .aspect-ratio %build %configure --disable-static --disable-scrollkeeper \ @@ -269,6 +272,11 @@ fi %{_libdir}/evince/1/backends/djvudocument.evince-backend %changelog +* Thu Oct 29 2009 Marek Kasik - 2.28.1-5 +- Add backported patch evince-aspect-ratio.patch (#531430). +- Preserve aspect ratio of scaled pages and set page orientation +- automatically (gnome bugs #599468 and #599470) + * Tue Oct 27 2009 Matthias Clasen - 2.28.1-4 - Avoid a help file seriesid clash