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 Diff line number Diff line
@@ -88,11 +88,12 @@ const BOX2I VIEW_GROUP::ViewBBox() const
void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
{
    PAINTER* painter = m_view->GetPainter();
    aGal->PushDepth();

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

        int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
        item->ViewGetLayers( 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
            }
        }
    }

        aGal->PopDepth();
    }
}


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

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

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

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