[gimp/gimp-2-10] plug-ins: fix #3964 Incorrect position when printing



commit 6c7da6729ab44b3bab5f6ff7b5f8739a05b416bd
Author: Jacob Boerema <jgboerema gmail com>
Date:   Fri Apr 29 12:59:38 2022 -0400

    plug-ins: fix #3964 Incorrect position when printing
    
    This was a long standing issue where the image was not printed at the
    position as selected in our print preview.
    
    The problem being that we do not take into account the dpi of the print
    context we are printing to, but instead always assumed 72.
    This is the fix that was suggested by Massimo.
    
    (cherry picked from commit 0e462440cce65e48acd2d62740e27f38b4d6a28a)

 plug-ins/print/print-draw-page.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/plug-ins/print/print-draw-page.c b/plug-ins/print/print-draw-page.c
index 22c313d04e..588cbdec0f 100644
--- a/plug-ins/print/print-draw-page.c
+++ b/plug-ins/print/print-draw-page.c
@@ -66,7 +66,9 @@ print_draw_page (GtkPrintContext *context,
       scale_x = gtk_print_context_get_dpi_x (context) / data->xres;
       scale_y = gtk_print_context_get_dpi_y (context) / data->yres;
 
-      cairo_translate (cr, data->offset_x, data->offset_y);
+      cairo_translate (cr,
+                       data->offset_x / 72.0 * gtk_print_context_get_dpi_x (context),
+                       data->offset_y / 72.0 * gtk_print_context_get_dpi_y (context));
 
       if (data->draw_crop_marks)
         print_draw_crop_marks (context,


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