Skip to content

Commit c998ca2

Browse files
author
wonder
committed
Draw layers in composer in correct order.
git-svn-id: http://svn.osgeo.org/qgis/trunk@6919 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 0e6afd6 commit c998ca2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/app/composer/qgscomposermap.cpp

+2-8
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void QgsComposerMap::draw ( QPainter *painter, QgsRect &extent, QgsMapToPixel *t
112112
int nlayers = mMapCanvas->layerCount();
113113
QgsCoordinateTransform* ct;
114114

115-
for ( int i = 0; i < nlayers; i++ ) {
115+
for ( int i = nlayers - 1; i >= 0; i-- ) {
116116
QgsMapLayer *layer = mMapCanvas->getZpos(i);
117117

118118
if (mMapCanvas->projectionsEnabled())
@@ -124,9 +124,6 @@ void QgsComposerMap::draw ( QPainter *painter, QgsRect &extent, QgsMapToPixel *t
124124
ct = NULL;
125125
}
126126

127-
// TODO: what to do with invisible layers
128-
//if ( !layer->visible() ) continue;
129-
130127
if ( layer->type() == QgsMapLayer::VECTOR ) {
131128
QgsVectorLayer *vector = dynamic_cast <QgsVectorLayer*> (layer);
132129

@@ -179,7 +176,7 @@ void QgsComposerMap::draw ( QPainter *painter, QgsRect &extent, QgsMapToPixel *t
179176
}
180177

181178
// Draw vector labels
182-
for ( int i = 0; i < nlayers; i++ ) {
179+
for ( int i = nlayers - 1; i >= 0; i-- ) {
183180
QgsMapLayer *layer = mMapCanvas->getZpos(i);
184181

185182
if (mMapCanvas->projectionsEnabled())
@@ -191,9 +188,6 @@ void QgsComposerMap::draw ( QPainter *painter, QgsRect &extent, QgsMapToPixel *t
191188
ct = NULL;
192189
}
193190

194-
// TODO: what to do with invisible layers
195-
//if ( !layer->visible() ) continue;
196-
197191
if ( layer->type() == QgsMapLayer::VECTOR ) {
198192
QgsVectorLayer *vector = dynamic_cast <QgsVectorLayer*> (layer);
199193

0 commit comments

Comments
 (0)