void SCH_TEXT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& aOffset, GR_DRAWMODE DrawMode, EDA_COLOR_T Color ) { EDA_COLOR_T color; int linewidth = ( m_Thickness == 0 ) ? GetDefaultLineThickness() : m_Thickness; linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold ); if( Color >= 0 ) color = Color; else color = ReturnLayerColor( m_Layer ); GRSetDrawMode( DC, DrawMode ); wxPoint text_offset = aOffset + GetSchematicTextOffset(); EXCHG( linewidth, m_Thickness ); // Set the minimum width EDA_TEXT::Draw( panel, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR ); EXCHG( linewidth, m_Thickness ); // set initial value if( m_isDangling ) DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color ); // Enable these line to draw the bounding box (debug tests purposes only) #if 0 { EDA_RECT BoundaryBox = GetBoundingBox(); GRRect( panel->GetClipBox(), DC, BoundaryBox, 0, BROWN ); } #endif }
void SCH_HIERLABEL::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset, GR_DRAWMODE DrawMode, EDA_COLOR_T Color ) { static std::vector <wxPoint> Poly; EDA_COLOR_T color; int linewidth = m_Thickness == 0 ? GetDefaultLineThickness() : m_Thickness; EDA_RECT* clipbox = panel? panel->GetClipBox() : NULL; linewidth = Clamp_Text_PenSize( linewidth, m_Size, m_Bold ); if( Color >= 0 ) color = Color; else color = GetLayerColor( m_Layer ); GRSetDrawMode( DC, DrawMode ); std::swap( linewidth, m_Thickness ); // Set the minimum width wxPoint text_offset = offset + GetSchematicTextOffset(); EDA_TEXT::Draw( clipbox, DC, text_offset, color, DrawMode, FILLED, UNSPECIFIED_COLOR ); std::swap( linewidth, m_Thickness ); // set initial value CreateGraphicShape( Poly, m_Pos + offset ); GRPoly( clipbox, DC, Poly.size(), &Poly[0], 0, linewidth, color, color ); if( m_isDangling && panel ) DrawDanglingSymbol( panel, DC, m_Pos + offset, color ); // Enable these line to draw the bounding box (debug tests purposes only) #if 0 { EDA_RECT BoundaryBox = GetBoundingBox(); GRRect( clipbox, DC, BoundaryBox, 0, BROWN ); } #endif }