From 86000832fe6aa3877e8591f24b961914c29688ae Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 2 Oct 2013 10:19:48 +0200 Subject: [PATCH] Added typedefs for VIEW_GROUP iterators. Fixed improper order of layer drawing for VIEW_GROUP items. --- common/view/view_group.cpp | 9 ++++----- include/view/view_group.h | 8 ++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/common/view/view_group.cpp b/common/view/view_group.cpp index 996350b1f3..62ef738c82 100644 --- a/common/view/view_group.cpp +++ b/common/view/view_group.cpp @@ -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(); + aGal->PopDepth(); + } } @@ -158,5 +159,3 @@ void VIEW_GROUP::updateBbox() view->Remove( this ); view->Add( this ); } - - diff --git a/include/view/view_group.h b/include/view/view_group.h index 5414b041f2..bdec53eacb 100644 --- a/include/view/view_group.h +++ b/include/view/view_group.h @@ -45,6 +45,10 @@ public: VIEW_GROUP( VIEW* aView = NULL ); virtual ~VIEW_GROUP(); + /// Helper typedefs + typedef std::set::const_iterator const_iter; + typedef std::set::iterator iter; + /** * Function Add() * Adds an item to the group. @@ -71,7 +75,7 @@ public: * Function Begin() * Returns iterator to beginning. */ - inline std::set::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::const_iterator End() const + inline const_iter End() const { return m_items.end(); }