Commit e799d7a0 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Fixed drawing of PCB_TARGET items.

parent fde71bdf
Loading
Loading
Loading
Loading
+26 −10
Original line number Original line Diff line number Diff line
@@ -551,20 +551,36 @@ void PCB_PAINTER::draw( const DIMENSION* aDimension )
void PCB_PAINTER::draw( const PCB_TARGET* aTarget )
void PCB_PAINTER::draw( const PCB_TARGET* aTarget )
{
{
    COLOR4D  strokeColor = getLayerColor( aTarget->GetLayer(), 0 );
    COLOR4D  strokeColor = getLayerColor( aTarget->GetLayer(), 0 );
    double  radius;
    VECTOR2D position( aTarget->GetPosition() );
    double   size, radius;

    m_gal->SetLineWidth( aTarget->GetWidth() );
    m_gal->SetStrokeColor( strokeColor );
    m_gal->SetIsFill( false );
    m_gal->SetIsStroke( true );

    m_gal->Save();
    m_gal->Translate( position );


    // according to PCB_TARGET::Draw() (class_mire.cpp)
    if( aTarget->GetShape() )
    if( aTarget->GetShape() )    // shape X
    {
    {
        radius = aTarget->GetSize() / 2;
        // shape x
        m_gal->Rotate( M_PI / 4.0 );
        size   = 2.0 * aTarget->GetSize() / 3.0;
        radius = aTarget->GetSize() / 2.0;
    }
    }
    else
    else
    {
    {
        radius = aTarget->GetSize() / 3;
        // shape +
        size   = aTarget->GetSize() / 2.0;
        radius = aTarget->GetSize() / 3.0;
    }
    }


    m_gal->SetStrokeColor( strokeColor );
    m_gal->DrawLine( VECTOR2D( -size, 0.0 ),
    m_gal->SetIsFill( true );
                     VECTOR2D(  size, 0.0 ) );
    m_gal->SetIsStroke( true );
    m_gal->DrawLine( VECTOR2D( 0.0, -size ),
    m_gal->DrawCircle( VECTOR2D( aTarget->GetPosition() ), radius );
                     VECTOR2D( 0.0,  size ) );
    m_gal->DrawCircle( VECTOR2D( 0.0, 0.0 ), radius );

    m_gal->Restore();
}
}