From 76bdb423d72ee0050886be02636c60d1b43e3ff8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 4 Aug 2021 16:47:41 +0200 Subject: [PATCH] Minor changes: minor code cleanup and fix minor Coverity warning --- eeschema/sch_sheet.cpp | 27 +++++-------------- gerbview/excellon_image.h | 4 ++- .../dialogs/dialog_footprint_properties.cpp | 1 + 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index b47dca9342..3a2c51cad9 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -973,34 +973,19 @@ void SCH_SHEET::Plot( PLOTTER* aPlotter ) const if( override || backgroundColor == COLOR4D::UNSPECIFIED ) backgroundColor = aPlotter->RenderSettings()->GetLayerColor( LAYER_SHEET_BACKGROUND ); - aPlotter->SetColor( backgroundColor ); // Do not fill shape in B&W mode, otherwise texts are unreadable bool fill = aPlotter->GetColorMode(); - aPlotter->Rect( m_pos, m_pos + m_size, fill ? FILL_TYPE::FILLED_SHAPE : FILL_TYPE::NO_FILL, - 1.0 ); + if( fill ) + { + aPlotter->SetColor( backgroundColor ); + aPlotter->Rect( m_pos, m_pos + m_size, FILL_TYPE::FILLED_SHAPE, 1 ); + } aPlotter->SetColor( borderColor ); int penWidth = std::max( GetPenWidth(), aPlotter->RenderSettings()->GetMinPenWidth() ); - aPlotter->SetCurrentLineWidth( penWidth ); - - aPlotter->MoveTo( m_pos ); - pos = m_pos; - pos.x += m_size.x; - - aPlotter->LineTo( pos ); - pos.y += m_size.y; - - aPlotter->LineTo( pos ); - pos = m_pos; - pos.y += m_size.y; - - aPlotter->LineTo( pos ); - aPlotter->FinishTo( m_pos ); - - for( SCH_FIELD field : m_fields ) - field.Plot( aPlotter ); + aPlotter->Rect( m_pos, m_pos + m_size, FILL_TYPE::NO_FILL, penWidth ); /* Draw texts : SheetLabel */ for( SCH_SHEET_PIN* sheetPin : m_pins ) diff --git a/gerbview/excellon_image.h b/gerbview/excellon_image.h index ed2f2572f4..f83c4acfa4 100644 --- a/gerbview/excellon_image.h +++ b/gerbview/excellon_image.h @@ -131,7 +131,8 @@ struct EXCELLON_ROUTE_COORD * Handle a drill image. * * It is derived from #GERBER_FILE_IMAGE because there is a lot of likeness between EXCELLON - * files and GERBER files. DCode aperture are also similar to T Codes. + * files and GERBER files. + * DCode apertures are also similar to T Codes. */ class EXCELLON_IMAGE : public GERBER_FILE_IMAGE { @@ -141,6 +142,7 @@ public: EXCELLON_IMAGE( int layer ) : m_State = READ_HEADER_STATE; m_SlotOn = false; m_RouteModeOn = false; + m_hasFormat = false; } diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 0e0b07ed48..222e3f81eb 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -82,6 +82,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen m_delayedFocusGrid = nullptr; m_delayedFocusRow = -1; m_delayedFocusColumn = -1; + m_initialFocus = false; // Give an icon wxIcon icon;