Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for canvas item order in print composer (ticket #2755)
git-svn-id: http://svn.osgeo.org/qgis/trunk@13633 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 3, 2010
1 parent 8ff807c commit 8c401d3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -1411,16 +1411,21 @@ void QgsComposerMap::drawCanvasItems( QPainter* painter, const QStyleOptionGraph
}

QList<QGraphicsItem*> itemList = mMapCanvas->items();
if ( itemList.size() < 1 )
{
return;
}

QList<QGraphicsItem*>::iterator itemIt = itemList.begin();
for ( ; itemIt != itemList.end(); ++itemIt )
QGraphicsItem* currentItem = 0;
for ( int i = itemList.size() - 1; i >= 0; --i )
{
currentItem = itemList.at( i );
//don't draw mapcanvasmap (has z value -10)
if ( !( *itemIt ) || ( *itemIt )->zValue() == -10 )
if ( !currentItem || currentItem->zValue() == -10 )
{
continue;
}
drawCanvasItem( *itemIt, painter, itemStyle );
drawCanvasItem( currentItem, painter, itemStyle );
}
}

Expand Down

0 comments on commit 8c401d3

Please sign in to comment.