mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 20:12:30 +00:00
Bug 524615 – Print not to scale
2008-10-22 Sven Neumann <sven@gimp.org> Bug 524615 – Print not to scale * plug-ins/print/print.c: set the unit for dimensions on the Cairo context used for printing to GTK_UNIT_PIXELS. * plug-ins/print/print-draw-page.c (print_draw_page): changed the Cairo scale factors accordingly. Seems to fix printing on Windows. svn path=/trunk/; revision=27364
This commit is contained in:
parent
883cb6da5b
commit
e959bf084c
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2008-10-22 Sven Neumann <sven@gimp.org>
|
||||
|
||||
Bug 524615 – Print not to scale
|
||||
|
||||
* plug-ins/print/print.c: set the unit for dimensions on the Cairo
|
||||
context used for printing to GTK_UNIT_PIXELS.
|
||||
|
||||
* plug-ins/print/print-draw-page.c (print_draw_page): changed the
|
||||
Cairo scale factors accordingly. Seems to fix printing on Windows.
|
||||
|
||||
2008-10-22 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpprogressbox.c: set box->progress to NULL in
|
||||
|
|
|
@ -133,25 +133,15 @@ print_draw_page (GtkPrintContext *context,
|
|||
{
|
||||
cairo_t *cr;
|
||||
cairo_surface_t *surface;
|
||||
gdouble cr_width;
|
||||
gdouble cr_height;
|
||||
gdouble cr_dpi_x;
|
||||
gdouble cr_dpi_y;
|
||||
|
||||
cr = gtk_print_context_get_cairo_context (context);
|
||||
|
||||
surface = print_cairo_surface_from_drawable (data->drawable_id);
|
||||
|
||||
cr_width = gtk_print_context_get_width (context);
|
||||
cr_height = gtk_print_context_get_height (context);
|
||||
cr_dpi_x = gtk_print_context_get_dpi_x (context);
|
||||
cr_dpi_y = gtk_print_context_get_dpi_y (context);
|
||||
|
||||
cairo_translate (cr,
|
||||
data->offset_x / cr_dpi_x * 72.0,
|
||||
data->offset_y / cr_dpi_y * 72.0);
|
||||
cairo_translate (cr, data->offset_x, data->offset_y);
|
||||
cairo_scale (cr,
|
||||
cr_dpi_x / data->xres, cr_dpi_y / data->yres);
|
||||
gtk_print_context_get_dpi_x (context) / data->xres,
|
||||
gtk_print_context_get_dpi_y (context) / data->yres);
|
||||
|
||||
cairo_rectangle (cr,
|
||||
0, 0,
|
||||
|
|
|
@ -234,7 +234,7 @@ print_image (gint32 image_ID,
|
|||
|
||||
print_settings_load (&data);
|
||||
|
||||
gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS);
|
||||
gtk_print_operation_set_unit (operation, GTK_UNIT_PIXEL);
|
||||
|
||||
g_signal_connect (operation, "begin-print",
|
||||
G_CALLBACK (begin_print),
|
||||
|
|
Loading…
Reference in a new issue