From b471f8d70cbbe49259b2e659f6d4174487748b01 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 22 Apr 2010 19:47:10 +0200 Subject: [PATCH] Fixed minor bugs and printing problems, and others minor enhancements --- CHANGELOG.txt | 5 ++ gerbview/dialog_print_using_printer.cpp | 19 ++++++ gerbview/dialog_print_using_printer_base.cpp | 10 ++-- gerbview/dialog_print_using_printer_base.fbp | 10 ++-- gerbview/dialog_print_using_printer_base.h | 1 + pcbnew/dialog_print_using_printer.cpp | 19 ++++++ pcbnew/dialog_print_using_printer_base.cpp | 2 + pcbnew/dialog_print_using_printer_base.fbp | 2 +- pcbnew/dialog_print_using_printer_base.h | 1 + pcbnew/dimension.cpp | 62 ++++++++++++-------- pcbnew/onleftclick.cpp | 6 +- pcbnew/plot_rtn.cpp | 18 +++++- 12 files changed, 118 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c797f5ea78..c72f333641 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,11 @@ KiCad ChangeLog 2010 Please add newer entries at the top, list the date and your name with email address. +2010-apr-22, UPDATE Jean-Pierre Charras +================================================================================ +++Pcbnew+Gerbview: + Fixed minor problems in printing. + 2010-apr-19, UPDATE Jean-Pierre Charras ================================================================================ ++Pcbnew: diff --git a/gerbview/dialog_print_using_printer.cpp b/gerbview/dialog_print_using_printer.cpp index 8c414de4bf..b8702471ef 100644 --- a/gerbview/dialog_print_using_printer.cpp +++ b/gerbview/dialog_print_using_printer.cpp @@ -62,6 +62,7 @@ private: void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void SetPrintParameters( ); @@ -210,6 +211,8 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) } m_ScaleOption->SetSelection( scale_idx ); + scale_idx = m_ScaleOption->GetSelection(); + s_Parameters.m_PrintScale = s_ScaleList[scale_idx]; m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror); @@ -225,6 +228,12 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) m_FineAdjustXscaleOpt->SetValue( msg ); msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust ); m_FineAdjustYscaleOpt->SetValue( msg ); + + bool enable = (s_Parameters.m_PrintScale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); } /*************************************************/ @@ -336,6 +345,16 @@ void DIALOG_PRINT_USING_PRINTER::SetPrintParameters( ) g_pcb_plot_options.ScaleAdjX = s_Parameters.m_YScaleAdjust; } +void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event ) +{ + double scale = s_ScaleList[m_ScaleOption->GetSelection()]; + bool enable = (scale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); +} + /**********************************************************/ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) /**********************************************************/ diff --git a/gerbview/dialog_print_using_printer_base.cpp b/gerbview/dialog_print_using_printer_base.cpp index 0a71deeb19..03408f999d 100644 --- a/gerbview/dialog_print_using_printer_base.cpp +++ b/gerbview/dialog_print_using_printer_base.cpp @@ -95,16 +95,16 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare b_buttonsSizer = new wxBoxSizer( wxVERTICAL ); m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Options"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonOption, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonPreview = new wxButton( this, wxID_PREVIEW, _("Preview"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonPreview, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonPrint = new wxButton( this, wxID_PRINT_ALL, _("Print"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonPrint, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + b_buttonsSizer->Add( m_buttonQuit, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bMainSizer->Add( b_buttonsSizer, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -113,6 +113,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_ScaleOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this ); m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); @@ -123,6 +124,7 @@ DIALOG_PRINT_USING_PRINTER_base::~DIALOG_PRINT_USING_PRINTER_base() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_ScaleOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this ); m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); diff --git a/gerbview/dialog_print_using_printer_base.fbp b/gerbview/dialog_print_using_printer_base.fbp index 3dbb49ddfb..905768c375 100644 --- a/gerbview/dialog_print_using_printer_base.fbp +++ b/gerbview/dialog_print_using_printer_base.fbp @@ -182,7 +182,7 @@ - + OnScaleSelectionClick @@ -601,7 +601,7 @@ none 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 @@ -653,7 +653,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 @@ -705,7 +705,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 @@ -757,7 +757,7 @@ 5 - wxALL|wxALIGN_CENTER_HORIZONTAL + wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND 0 diff --git a/gerbview/dialog_print_using_printer_base.h b/gerbview/dialog_print_using_printer_base.h index a43ff13694..b00206c7b4 100644 --- a/gerbview/dialog_print_using_printer_base.h +++ b/gerbview/dialog_print_using_printer_base.h @@ -59,6 +59,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } + virtual void OnScaleSelectionClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnPageSetup( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } diff --git a/pcbnew/dialog_print_using_printer.cpp b/pcbnew/dialog_print_using_printer.cpp index 44d459c6c1..915333bcfa 100644 --- a/pcbnew/dialog_print_using_printer.cpp +++ b/pcbnew/dialog_print_using_printer.cpp @@ -63,6 +63,7 @@ private: void OnPageSetup( wxCommandEvent& event ); void OnPrintPreview( wxCommandEvent& event ); void OnPrintButtonClick( wxCommandEvent& event ); + void OnScaleSelectionClick( wxCommandEvent& event ); void OnButtonCancelClick( wxCommandEvent& event ) { Close(); } void SetPrintParameters( ); @@ -242,6 +243,8 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) } m_ScaleOption->SetSelection( scale_idx ); + scale_idx = m_ScaleOption->GetSelection(); + s_Parameters.m_PrintScale = s_ScaleList[scale_idx]; m_Print_Mirror->SetValue(s_Parameters.m_PrintMirror); m_Exclude_Edges_Pcb->SetValue(m_ExcludeEdgeLayer); m_Print_Sheet_Ref->SetValue( s_Parameters.m_Print_Sheet_Ref ); @@ -265,6 +268,12 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( ) m_FineAdjustXscaleOpt->SetValue( msg ); msg.Printf( wxT( "%f" ), s_Parameters.m_YScaleAdjust ); m_FineAdjustYscaleOpt->SetValue( msg ); + + bool enable = (s_Parameters.m_PrintScale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); } @@ -423,6 +432,16 @@ void DIALOG_PRINT_USING_PRINTER::SetPenWidth() ReturnStringFromValue( g_UnitMetric, s_Parameters.m_PenDefaultSize, m_Parent->m_InternalUnits ) ); } +void DIALOG_PRINT_USING_PRINTER::OnScaleSelectionClick( wxCommandEvent& event ) +{ + double scale = s_ScaleList[m_ScaleOption->GetSelection()]; + bool enable = (scale == 1.0); + if( m_FineAdjustXscaleOpt ) + m_FineAdjustXscaleOpt->Enable(enable); + if( m_FineAdjustYscaleOpt ) + m_FineAdjustYscaleOpt->Enable(enable); +} + /**********************************************************/ void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event ) diff --git a/pcbnew/dialog_print_using_printer_base.cpp b/pcbnew/dialog_print_using_printer_base.cpp index d04c8612b1..5a03b9e18f 100644 --- a/pcbnew/dialog_print_using_printer_base.cpp +++ b/pcbnew/dialog_print_using_printer_base.cpp @@ -148,6 +148,7 @@ DIALOG_PRINT_USING_PRINTER_base::DIALOG_PRINT_USING_PRINTER_base( wxWindow* pare // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_ScaleOption->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); m_buttonOption->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this ); m_buttonPreview->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); m_buttonPrint->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); @@ -158,6 +159,7 @@ DIALOG_PRINT_USING_PRINTER_base::~DIALOG_PRINT_USING_PRINTER_base() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnCloseWindow ) ); + m_ScaleOption->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnScaleSelectionClick ), NULL, this ); m_buttonOption->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPageSetup ), NULL, this ); m_buttonPreview->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintPreview ), NULL, this ); m_buttonPrint->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_USING_PRINTER_base::OnPrintButtonClick ), NULL, this ); diff --git a/pcbnew/dialog_print_using_printer_base.fbp b/pcbnew/dialog_print_using_printer_base.fbp index d0ff578762..a6621135b6 100644 --- a/pcbnew/dialog_print_using_printer_base.fbp +++ b/pcbnew/dialog_print_using_printer_base.fbp @@ -234,7 +234,7 @@ - + OnScaleSelectionClick diff --git a/pcbnew/dialog_print_using_printer_base.h b/pcbnew/dialog_print_using_printer_base.h index 66cdd24462..38d342159e 100644 --- a/pcbnew/dialog_print_using_printer_base.h +++ b/pcbnew/dialog_print_using_printer_base.h @@ -67,6 +67,7 @@ class DIALOG_PRINT_USING_PRINTER_base : public wxDialog // Virtual event handlers, overide them in your derived class virtual void OnCloseWindow( wxCloseEvent& event ){ event.Skip(); } + virtual void OnScaleSelectionClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnPageSetup( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintPreview( wxCommandEvent& event ){ event.Skip(); } virtual void OnPrintButtonClick( wxCommandEvent& event ){ event.Skip(); } diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index 382e696977..3e97a63b0d 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -4,10 +4,12 @@ #include "fctsys.h" #include "common.h" +#include "confirm.h" #include "class_drawpanel.h" #include "pcbnew.h" #include "wxPcbStruct.h" #include "class_board_design_settings.h" +#include "drawtxt.h" /* Routines Locales */ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC ); @@ -23,10 +25,10 @@ static int status_cotation; /* = 0 : pas de cotation en cours * Les routines generent une cotation de la forme * - cote usuelle: * - | | - | dist | - |<---------->| - | | + * | | + * | dist | + * |<---------->| + * | | * */ @@ -40,10 +42,10 @@ enum id_Cotation_properties { }; /************************************/ -/* class WinEDA_CotationPropertiesFrame */ +/* class DIMENSION_EDITOR_DIALOG */ /************************************/ -class WinEDA_CotationPropertiesFrame : public wxDialog +class DIMENSION_EDITOR_DIALOG : public wxDialog { private: @@ -59,9 +61,9 @@ private: public: // Constructor and destructor - WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent, + DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, COTATION* Cotation, wxDC* DC, const wxPoint& pos ); - ~WinEDA_CotationPropertiesFrame() + ~DIMENSION_EDITOR_DIALOG() { } @@ -73,13 +75,13 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE( WinEDA_CotationPropertiesFrame, wxDialog ) -EVT_BUTTON( wxID_OK, WinEDA_CotationPropertiesFrame::OnOkClick ) -EVT_BUTTON( wxID_CANCEL, WinEDA_CotationPropertiesFrame::OnCancelClick ) +BEGIN_EVENT_TABLE( DIMENSION_EDITOR_DIALOG, wxDialog ) +EVT_BUTTON( wxID_OK, DIMENSION_EDITOR_DIALOG::OnOkClick ) +EVT_BUTTON( wxID_CANCEL, DIMENSION_EDITOR_DIALOG::OnCancelClick ) END_EVENT_TABLE() -WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* parent, +DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( WinEDA_PcbFrame* parent, COTATION* Cotation, wxDC* DC, const wxPoint& framepos ) : wxDialog( parent, -1, _( "Dimension properties" ), framepos, wxSize( 340, 270 ), @@ -146,7 +148,7 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame* /**********************************************************************/ -void WinEDA_CotationPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) +void DIMENSION_EDITOR_DIALOG::OnCancelClick( wxCommandEvent& WXUNUSED (event) ) /**********************************************************************/ { EndModal( -1 ); @@ -154,7 +156,7 @@ void WinEDA_CotationPropertiesFrame::OnCancelClick( wxCommandEvent& WXUNUSED (ev /***********************************************************************************/ -void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event ) +void DIMENSION_EDITOR_DIALOG::OnOkClick( wxCommandEvent& event ) /***********************************************************************************/ { if( m_DC ) // Effacement ancien texte @@ -169,8 +171,16 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event ) } CurrentCotation->m_Text->m_Size = m_TxtSizeCtrl->GetValue(); - CurrentCotation->m_Text->m_Width = CurrentCotation->m_Width = - m_TxtWidthCtrl->GetValue(); + + int width = m_TxtWidthCtrl->GetValue(); + int maxthickness = Clamp_Text_PenSize(width, CurrentCotation->m_Text->m_Size ); + if( width > maxthickness ) + { + DisplayError(NULL, _("The text thickness is too large for the text size. It will be clamped")); + width = maxthickness; + } + CurrentCotation->m_Text->m_Width = CurrentCotation->m_Width = width ; + CurrentCotation->m_Text->m_Mirror = (m_Mirror->GetSelection() == 1) ? true : false; CurrentCotation->SetLayer( m_SelLayerBox->GetChoice() + FIRST_NO_COPPER_LAYER ); @@ -227,8 +237,6 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) Cotation->m_Flags = IS_NEW; Cotation->SetLayer( getActiveLayer() ); - Cotation->m_Width = GetBoard()->GetBoardDesignSettings()->m_DrawSegmentWidth; - Cotation->m_Text->m_Width = Cotation->m_Width; Cotation->Barre_ox = Cotation->Barre_fx = pos.x; Cotation->Barre_oy = Cotation->Barre_fy = pos.y; @@ -252,8 +260,14 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) Cotation->FlecheD2_oy = Cotation->FlecheD2_fy = pos.y; Cotation->m_Text->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize; - Cotation->m_Text->m_Width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth; - + int width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth; + int maxthickness = Clamp_Text_PenSize(width, Cotation->m_Text->m_Size ); + if( width > maxthickness ) + { + width = maxthickness; + } + Cotation->m_Text->m_Width = Cotation->m_Width = width ; + Ajuste_Details_Cotation( Cotation ); Cotation->Draw( DrawPanel, DC, GR_XOR ); @@ -273,8 +287,11 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) Cotation->Draw( DrawPanel, DC, GR_OR ); Cotation->m_Flags = 0; - /* Insertion de la structure dans le Chainage .Drawings du PCB */ + /* ADD this new item in list */ GetBoard()->Add( Cotation ); + + // Add store it in undo/redo list + SaveCopyInUndoList( Cotation, UR_NEW ); OnModify(); DrawPanel->ManageCurseur = NULL; @@ -347,8 +364,7 @@ void WinEDA_PcbFrame::Install_Edit_Cotation( COTATION* Cotation, if( Cotation == NULL ) return; - WinEDA_CotationPropertiesFrame* frame = new WinEDA_CotationPropertiesFrame( this, - Cotation, DC, pos ); + DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, Cotation, DC, pos ); Ajuste_Details_Cotation( Cotation, true ); frame->ShowModal(); diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index 75b02e6c2e..12049e933e 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -88,6 +88,10 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) } break; + case TYPE_COTATION: + // see above. + break; + default: if( m_ID_current_state == 0 ) { @@ -348,7 +352,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawPanel->m_AutoPAN_Request = true; } else - DisplayError( this, wxT( "Internal err: Struct not COTATION" ) ); + DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() error item is not a DIMENSION" ) ); break; case ID_PCB_DELETE_ITEM_BUTT: diff --git a/pcbnew/plot_rtn.cpp b/pcbnew/plot_rtn.cpp index 1553089428..b1a25d5172 100644 --- a/pcbnew/plot_rtn.cpp +++ b/pcbnew/plot_rtn.cpp @@ -262,11 +262,17 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, if( pt_texte->m_Mirror ) NEGATE( size.x ); // Text is mirrored + // Non bold texts thickness is clamped at 1/6 char size by the low level draw function. + // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size + // (like bold text) and we manage the thickness. + // So we set bold flag to true + bool allow_bold = pt_texte->m_Bold || thickness; + plotter->text( pos, BLACK, pt_texte->m_Text, orient, size, pt_texte->m_HJustify, pt_texte->m_VJustify, - thickness, pt_texte->m_Italic, pt_texte->m_Bold ); + thickness, pt_texte->m_Italic, allow_bold ); } @@ -511,6 +517,12 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, if( pt_texte->m_Mirror ) size.x = -size.x; + // Non bold texts thickness is clamped at 1/6 char size by the low level draw function. + // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size + // (like bold text) and we manage the thickness. + // So we set bold flag to true + bool allow_bold = pt_texte->m_Bold || thickness; + if( pt_texte->m_MultilineAllowed ) { wxArrayString* list = wxStringSplit( pt_texte->m_Text, '\n' ); @@ -526,7 +538,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, txt, orient, size, pt_texte->m_HJustify, pt_texte->m_VJustify, - thickness, pt_texte->m_Italic, pt_texte->m_Bold ); + thickness, pt_texte->m_Italic, allow_bold ); pos += offset; } @@ -537,7 +549,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, pt_texte->m_Text, orient, size, pt_texte->m_HJustify, pt_texte->m_VJustify, - thickness, pt_texte->m_Italic, pt_texte->m_Bold ); + thickness, pt_texte->m_Italic, allow_bold ); }