From 906c52deff8573c1bb59ed4fdcb4943362acacbd Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 6 Sep 2018 17:55:37 +0200 Subject: [PATCH] minor compil warnings and drawings fix --- eeschema/class_libentry.cpp | 5 ++--- eeschema/lib_draw_item.cpp | 2 +- eeschema/sch_painter.cpp | 2 +- pcbnew/pcb_painter.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/eeschema/class_libentry.cpp b/eeschema/class_libentry.cpp index d3d6935945..834591c9be 100644 --- a/eeschema/class_libentry.cpp +++ b/eeschema/class_libentry.cpp @@ -342,7 +342,6 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset, int aMulti, int aConvert, const PART_DRAW_OPTIONS& aOpts ) { BASE_SCREEN* screen = aPanel ? aPanel->GetScreen() : NULL; - GRSetDrawMode( aDc, aOpts.draw_mode ); /* draw background for filled items using background option @@ -410,7 +409,7 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset, if( drawItem.Type() == LIB_FIELD_T ) { - LIB_FIELD& field = dynamic_cast( drawItem ); + LIB_FIELD& field = static_cast( drawItem ); if( field.IsVisible() && !aOpts.draw_visible_fields ) continue; @@ -421,7 +420,7 @@ void LIB_PART::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDc, const wxPoint& aOffset, if( drawItem.Type() == LIB_PIN_T ) { - LIB_PIN& pin = dynamic_cast( drawItem ); + LIB_PIN& pin = static_cast( drawItem ); uintptr_t flags = 0; if( aOpts.show_pin_text ) diff --git a/eeschema/lib_draw_item.cpp b/eeschema/lib_draw_item.cpp index 96f1644722..806ece92bf 100644 --- a/eeschema/lib_draw_item.cpp +++ b/eeschema/lib_draw_item.cpp @@ -146,10 +146,10 @@ void LIB_ITEM::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, m_Fill = fillMode; } else + #endif { drawGraphic( aPanel, aDC, aOffset, aColor, aDrawMode, aData, aTransform ); } - #endif } diff --git a/eeschema/sch_painter.cpp b/eeschema/sch_painter.cpp index 9ad02240a7..9f64e858f4 100644 --- a/eeschema/sch_painter.cpp +++ b/eeschema/sch_painter.cpp @@ -677,7 +677,7 @@ void SCH_PAINTER::draw( LIB_PIN *aPin, int aLayer, bool isDangling, bool isMovin // Four locations around a pin where text can be drawn enum { INSIDE = 0, OUTSIDE, ABOVE, BELOW }; int size[4] = { 0, 0, 0, 0 }; - int thickness[4]; + int thickness[4] = { numLineWidth, numLineWidth, numLineWidth, numLineWidth }; COLOR4D colour[4]; wxString text[4]; diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index c1df40a07b..48ad17ebaa 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -136,7 +136,7 @@ public: m_sketchBoardGfx = aEnabled; } - inline bool IsBackgroundDark() const + inline bool IsBackgroundDark() const override { auto luma = m_layerColors[ LAYER_PCB_BACKGROUND ].GetBrightness();