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

Added typedefs for VIEW_GROUP iterators. Fixed improper order of layer drawing...

Added typedefs for VIEW_GROUP iterators. Fixed improper order of layer drawing for VIEW_GROUP items.
parent 87a9964c
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -88,11 +88,12 @@ const BOX2I VIEW_GROUP::ViewBBox() const
void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
{
{
    PAINTER* painter = m_view->GetPainter();
    PAINTER* painter = m_view->GetPainter();
    aGal->PushDepth();


    // Draw all items immediately (without caching)
    // Draw all items immediately (without caching)
    BOOST_FOREACH( VIEW_ITEM* item, m_items )
    BOOST_FOREACH( VIEW_ITEM* item, m_items )
    {
    {
        aGal->PushDepth();

        int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
        int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
        item->ViewGetLayers( layers, layers_count );
        item->ViewGetLayers( layers, layers_count );
        m_view->SortLayers( layers, layers_count );
        m_view->SortLayers( layers, layers_count );
@@ -107,10 +108,10 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
                    item->ViewDraw( layers[i], aGal );  // Alternative drawing method
                    item->ViewDraw( layers[i], aGal );  // Alternative drawing method
            }
            }
        }
        }
    }


        aGal->PopDepth();
        aGal->PopDepth();
    }
    }
}




void VIEW_GROUP::ViewGetLayers( int aLayers[], int& aCount ) const
void VIEW_GROUP::ViewGetLayers( int aLayers[], int& aCount ) const
@@ -158,5 +159,3 @@ void VIEW_GROUP::updateBbox()
    view->Remove( this );
    view->Remove( this );
    view->Add( this );
    view->Add( this );
}
}

+6 −2
Original line number Original line Diff line number Diff line
@@ -45,6 +45,10 @@ public:
    VIEW_GROUP( VIEW* aView = NULL );
    VIEW_GROUP( VIEW* aView = NULL );
    virtual ~VIEW_GROUP();
    virtual ~VIEW_GROUP();


    /// Helper typedefs
    typedef std::set<VIEW_ITEM*>::const_iterator const_iter;
    typedef std::set<VIEW_ITEM*>::iterator iter;

    /**
    /**
     * Function Add()
     * Function Add()
     * Adds an item to the group.
     * Adds an item to the group.
@@ -71,7 +75,7 @@ public:
     * Function Begin()
     * Function Begin()
     * Returns iterator to beginning.
     * Returns iterator to beginning.
     */
     */
    inline std::set<VIEW_ITEM*>::const_iterator Begin() const
    inline const_iter Begin() const
    {
    {
        return m_items.begin();
        return m_items.begin();
    }
    }
@@ -80,7 +84,7 @@ public:
     * Function End()
     * Function End()
     * Returns iterator to end.
     * Returns iterator to end.
     */
     */
    inline std::set<VIEW_ITEM*>::const_iterator End() const
    inline const_iter End() const
    {
    {
        return m_items.end();
        return m_items.end();
    }
    }