Code

Clear Cairo surface to white before rendering preview
authormiklosh <miklosh@users.sourceforge.net>
Thu, 23 Aug 2007 11:23:22 +0000 (11:23 +0000)
committermiklosh <miklosh@users.sourceforge.net>
Thu, 23 Aug 2007 11:23:22 +0000 (11:23 +0000)
src/extension/internal/pdfinput/pdf-input.cpp

index c0982187af5c2f8b4a85440654e6e0e95bbd9923..ebe8c3ae2f9047a96409ed06576cc44e5cddf3a5 100644 (file)
@@ -522,6 +522,8 @@ void PdfImportDialog::_setPreviewPage(int page) {
     _cairo_surface = cairo_image_surface_create_for_data(_thumb_data,
             CAIRO_FORMAT_ARGB32, _thumb_width, _thumb_height, _thumb_rowstride);
     cairo_t *cr = cairo_create(_cairo_surface);
+    cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 1.0);  // Set fill color to white
+    cairo_paint(cr);    // Clear it
     cairo_scale(cr, scale_factor, scale_factor);    // Use Cairo for resizing the image
     _preview_output_dev->setCairo(cr);
     // Render page