From 9c6977a994307cbd34d4ec18244425247bd24360 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 8 Oct 2020 13:26:40 +0100 Subject: [PATCH] Remember mirror setting in print dialog. Fixes https://gitlab.com/kicad/code/kicad/issues/5909 --- pcbnew/pcbnew_printout.cpp | 2 ++ pcbnew/pcbnew_settings.cpp | 3 +++ pcbnew/pcbnew_settings.h | 1 + pcbnew/tools/drawing_tool.cpp | 1 - 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcbnew_printout.cpp b/pcbnew/pcbnew_printout.cpp index 31288a2491..a412e42511 100644 --- a/pcbnew/pcbnew_printout.cpp +++ b/pcbnew/pcbnew_printout.cpp @@ -51,6 +51,7 @@ void PCBNEW_PRINTOUT_SETTINGS::Load( APP_SETTINGS_BASE* aConfig ) { m_drillMarks = static_cast( cfg->m_Plot.pads_drill_mode ); m_pagination = static_cast( cfg->m_Plot.one_page_per_layer ); + m_mirror = cfg->m_Plot.mirror; } } @@ -63,6 +64,7 @@ void PCBNEW_PRINTOUT_SETTINGS::Save( APP_SETTINGS_BASE* aConfig ) { cfg->m_Plot.pads_drill_mode = m_drillMarks; cfg->m_Plot.one_page_per_layer = m_pagination; + cfg->m_Plot.mirror = m_mirror; } } diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 5993f67904..9af5d02ea2 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -385,6 +385,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "plot.check_zones_before_plotting", &m_Plot.check_zones_before_plotting, true ) ); + m_params.emplace_back( new PARAM( "plot.mirror", + &m_Plot.mirror, false ) ); + m_params.emplace_back( new PARAM( "window.footprint_text_shown_columns", &m_FootprintTextShownColumns, "0 1 2 3 4 5 6" ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 20f6642e6b..77bb13b7c5 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -187,6 +187,7 @@ public: double fine_scale_y; double ps_fine_width_adjust; bool check_zones_before_plotting; + bool mirror; }; struct DIALOG_REANNOTATE diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 11d2e16da9..05b922d76f 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -620,7 +620,6 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) return 0; TOOL_EVENT originalEvent = aEvent; - POINT_EDITOR* pointEditor = m_toolMgr->GetTool(); DIMENSION* dimension = nullptr; BOARD_COMMIT commit( m_frame ); GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() );