mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 22:35:59 +01:00
Workaround printing quality issues
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
1241afbe89
commit
7d7fe1d864
1 changed files with 4 additions and 3 deletions
7
print.c
7
print.c
|
@ -120,8 +120,9 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext*
|
||||||
const gdouble width = gtk_print_context_get_width(context);
|
const gdouble width = gtk_print_context_get_width(context);
|
||||||
const gdouble height = gtk_print_context_get_height(context);
|
const gdouble height = gtk_print_context_get_height(context);
|
||||||
|
|
||||||
const double page_height = zathura_page_get_height(page);
|
/* Render to a surface that is 5 times larger to workaround quality issues. */
|
||||||
const double page_width = zathura_page_get_width(page);
|
const double page_height = zathura_page_get_height(page) * 5;
|
||||||
|
const double page_width = zathura_page_get_width(page) * 5;
|
||||||
cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height);
|
cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height);
|
||||||
if (surface == NULL) {
|
if (surface == NULL) {
|
||||||
gtk_print_operation_cancel(print_operation);
|
gtk_print_operation_cancel(print_operation);
|
||||||
|
@ -143,7 +144,7 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext*
|
||||||
cairo_restore(temp_cairo);
|
cairo_restore(temp_cairo);
|
||||||
|
|
||||||
/* Render the page to the temporary surface */
|
/* Render the page to the temporary surface */
|
||||||
girara_debug("printing page %d ...", page_number);
|
girara_debug("printing page %d (fallback) ...", page_number);
|
||||||
zathura_renderer_lock(zathura->sync.render_thread);
|
zathura_renderer_lock(zathura->sync.render_thread);
|
||||||
err = zathura_page_render(page, temp_cairo, true);
|
err = zathura_page_render(page, temp_cairo, true);
|
||||||
zathura_renderer_unlock(zathura->sync.render_thread);
|
zathura_renderer_unlock(zathura->sync.render_thread);
|
||||||
|
|
Loading…
Reference in a new issue