Return meaningful default values for lpi and resolution

Change default values returned by gtk_print_settings_get_printer_lpi()
and gtk_print_settings_get_resolution{_x, _y}(). New values are 150 for
lpi and 300 for resolution (instead of 0) (#590861).
This commit is contained in:
Marek Kasik 2009-08-29 21:34:05 -04:00 committed by Matthias Clasen
parent 3b336186ee
commit f117777c20
4 changed files with 3 additions and 11 deletions

View File

@ -335,9 +335,6 @@ file_printer_create_cairo_surface (GtkPrinter *printer,
break;
}
if (gtk_print_settings_get_printer_lpi (settings) == 0.0)
gtk_print_settings_set_printer_lpi (settings, 150.0);
cairo_surface_set_fallback_resolution (surface,
2.0 * gtk_print_settings_get_printer_lpi (settings),
2.0 * gtk_print_settings_get_printer_lpi (settings));

View File

@ -211,9 +211,6 @@ lpr_printer_create_cairo_surface (GtkPrinter *printer,
surface = cairo_ps_surface_create_for_stream (_cairo_write, cache_io, width, height);
if (gtk_print_settings_get_printer_lpi (settings) == 0.0)
gtk_print_settings_set_printer_lpi (settings, 150.0);
cairo_surface_set_fallback_resolution (surface,
2.0 * gtk_print_settings_get_printer_lpi (settings),
2.0 * gtk_print_settings_get_printer_lpi (settings));

View File

@ -234,8 +234,9 @@ papi_printer_create_cairo_surface (GtkPrinter *printer,
surface = cairo_ps_surface_create_for_stream (_cairo_write, cache_io, width, height);
/* TODO: DPI from settings object? */
cairo_surface_set_fallback_resolution (surface, 300, 300);
cairo_surface_set_fallback_resolution (surface,
2.0 * gtk_print_settings_get_printer_lpi (settings),
2.0 * gtk_print_settings_get_printer_lpi (settings));
return surface;
}

View File

@ -305,9 +305,6 @@ test_printer_create_cairo_surface (GtkPrinter *printer,
else
surface = cairo_pdf_surface_create_for_stream (_cairo_write, cache_io, width, height);
if (gtk_print_settings_get_printer_lpi (settings) == 0.0)
gtk_print_settings_set_printer_lpi (settings, 150.0);
cairo_surface_set_fallback_resolution (surface,
2.0 * gtk_print_settings_get_printer_lpi (settings),
2.0 * gtk_print_settings_get_printer_lpi (settings));