From 281d77f6b3f3391a00cf18a085e65c53cb65ef77 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 25 Sep 2019 18:29:14 +0200 Subject: [PATCH] Cairo print, on GTK: use a better DPI definition to avoid artifacts rendering (GTK specific) Previously, a 600 DPI was used to set device scale (can create minor visible rounding issues). Using now 4800 DPI to reduce these rounding artifacts. Fixes: lp:1845229 https://bugs.launchpad.net/kicad/+bug/1845229 --- common/gal/cairo/cairo_print.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/gal/cairo/cairo_print.cpp b/common/gal/cairo/cairo_print.cpp index 6cef33e9bd..9b6ebe2c24 100644 --- a/common/gal/cairo/cairo_print.cpp +++ b/common/gal/cairo/cairo_print.cpp @@ -69,11 +69,13 @@ CAIRO_PRINT_CTX::CAIRO_PRINT_CTX( wxDC* aDC ) #ifdef __WXGTK__ m_ctx = static_cast( gctx->GetNativeContext() ); m_surface = cairo_get_target( m_ctx ); - // On linux, cairo printers are 72 DPI by default. This is an ususable resolution for us. - // A reasonable resolution is 600 DPI + // On linux, cairo printers have 72 DPI by default. + // This is an unusable resolution for us. + // A better resolution could be 4800 DPI (at 600 DPI, we still have minor + // but visible artifacts, for instance with arcs, but not at 4800 DPI) // so modify the default: #define DEFAULT_DPI 72.0 - #define KICAD_PRINTER_DPI 600.0 + #define KICAD_PRINTER_DPI 4800.0 // our device scale is DEFAULT_DPI / KICAD_PRINTER_DPI cairo_surface_set_device_scale( m_surface, DEFAULT_DPI/KICAD_PRINTER_DPI, DEFAULT_DPI/KICAD_PRINTER_DPI ); m_dpi = KICAD_PRINTER_DPI;