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

This commit is contained in:
Maciej Suminski 2013-10-02 10:19:48 +02:00
parent 87a9964c78
commit 86000832fe
2 changed files with 10 additions and 7 deletions

View File

@ -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,9 +108,9 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
item->ViewDraw( layers[i], aGal ); // Alternative drawing method
}
}
}
aGal->PopDepth();
}
}
@ -158,5 +159,3 @@ void VIEW_GROUP::updateBbox()
view->Remove( this );
view->Add( this );
}

View File

@ -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();
}