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
This commit is contained in:
jean-pierre charras 2019-09-25 18:29:14 +02:00
parent 3cd12088a3
commit 281d77f6b3
1 changed files with 5 additions and 3 deletions

View File

@ -69,11 +69,13 @@ CAIRO_PRINT_CTX::CAIRO_PRINT_CTX( wxDC* aDC )
#ifdef __WXGTK__
m_ctx = static_cast<cairo_t*>( 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;