mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
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:
parent
3b336186ee
commit
f117777c20
@ -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));
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user