Commit 9af45c05 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Fix for drawing polygons.

parent e799d7a0
Loading
Loading
Loading
Loading
+3 −12
Original line number Original line Diff line number Diff line
@@ -486,7 +486,6 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aContainer )
    COLOR4D fillColor = getLayerColor( aContainer->GetLayer(), aContainer->GetNet() );
    COLOR4D fillColor = getLayerColor( aContainer->GetLayer(), aContainer->GetNet() );
    std::vector<CPolyPt>::iterator polyIterator;
    std::vector<CPolyPt>::iterator polyIterator;
    std::deque<VECTOR2D> corners;
    std::deque<VECTOR2D> corners;
    VECTOR2D startPoint;
    int fillMode = aContainer->GetFillMode();
    int fillMode = aContainer->GetFillMode();


    m_gal->SetFillColor( fillColor );
    m_gal->SetFillColor( fillColor );
@@ -501,23 +500,15 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aContainer )


    if( fillMode == 0 )
    if( fillMode == 0 )
    {
    {
        startPoint = VECTOR2D( polyPoints.front() );
        for( polyIterator = polyPoints.begin(); polyIterator != polyPoints.end(); polyIterator++ )
        for( polyIterator = polyPoints.begin(); polyIterator != polyPoints.end(); polyIterator++ )
        {
        {
            // Find out all of polygons and then draw them
            // Find out all of polygons and then draw them
            if( !polyIterator->end_contour )
            {
            corners.push_back( VECTOR2D( *polyIterator ) );
            corners.push_back( VECTOR2D( *polyIterator ) );
            }

            else
            if( polyIterator->end_contour )
            {
            {
                m_gal->DrawPolygon( corners );
                m_gal->DrawPolygon( corners );

                // Closing point for polyline
                corners.push_back( VECTOR2D( startPoint ) );
                m_gal->DrawPolyline( corners );
                m_gal->DrawPolyline( corners );
                startPoint = VECTOR2D( *( polyIterator + 1 ) );

                corners.clear();
                corners.clear();
            }
            }
        }
        }