[gimp/gimp-2-8] Bug 777233 - Printing an SVG file results in a black sheet of paper



commit 2503054c10a2b96128ba0ef0c1a17390fc937b4a
Author: Michael Natterer <mitch gimp org>
Date:   Sun Jan 15 18:04:54 2017 +0100

    Bug 777233 - Printing an SVG file results in a black sheet of paper
    
    Create a white rectangle behind everything, which should take care of
    whatever print backend brokenness.
    
    (cherry picked from commit 80003dff38d55e35d8a7c6074df23e0c5209c8b7)

 plug-ins/print/print-draw-page.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/plug-ins/print/print-draw-page.c b/plug-ins/print/print-draw-page.c
index 39a9b98..f2a7870 100644
--- a/plug-ins/print/print-draw-page.c
+++ b/plug-ins/print/print-draw-page.c
@@ -44,15 +44,22 @@ print_draw_page (GtkPrintContext *context,
 {
   cairo_t         *cr = gtk_print_context_get_cairo_context (context);
   cairo_surface_t *surface;
-  gint             width;
-  gint             height;
-  gdouble          scale_x;
-  gdouble          scale_y;
 
   surface = print_surface_from_drawable (data->drawable_id, error);
 
   if (surface)
     {
+      gint    width;
+      gint    height;
+      gdouble scale_x;
+      gdouble scale_y;
+
+      /*  create a white rectangle covering the entire page, just
+       *  to be safe; see bug #777233.
+       */
+      cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
+      cairo_paint (cr);
+
       width  = cairo_image_surface_get_width (surface);
       height = cairo_image_surface_get_height (surface);
 
@@ -74,10 +81,8 @@ print_draw_page (GtkPrintContext *context,
 
       return TRUE;
     }
-  else
-    {
-      return FALSE;
-    }
+
+  return FALSE;
 }
 
 


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