Skip to content
Permalink
Browse files

Fix for bug #442

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6249 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Dec 13, 2006
1 parent 8975701 commit 8d0e068b024c70a4803851fb5cb40093c469c3fd
Showing with 19 additions and 8 deletions.
  1. +16 −8 src/legend/qgslegend.cpp
  2. +3 −0 src/legend/qgslegend.h
@@ -286,7 +286,8 @@ void QgsLegend::mouseReleaseEvent(QMouseEvent * e)

if(!dest || !origin)
{
return;
checkLayerOrderUpdate();
return;
}

if(dest && origin && getItemPos(dest) != mItemBeingMovedOrigPos)
@@ -348,13 +349,7 @@ void QgsLegend::mouseReleaseEvent(QMouseEvent * e)
origLayer->setLegend((QgsLegend*)(dynamic_cast<QgsLegendItem*>(dest->parent())->nextSibling()));
}
}

std::deque<QString> layersAfterRelease = layerIDs(); //test if canvas redraw is really necessary
if(layersAfterRelease != mLayersPriorToMove)
{
// z-order has changed - update layer set
updateMapCanvasLayerSet();
}
checkLayerOrderUpdate();
}
}
mMousePressedFlag = false;
@@ -1745,3 +1740,16 @@ void QgsLegend::zoomToLayerExtent()
mMapCanvas->render();
mMapCanvas->refresh();
}


bool QgsLegend::checkLayerOrderUpdate()
{
std::deque<QString> layersAfterRelease = layerIDs(); //test if canvas redraw is really necessary
if(layersAfterRelease != mLayersPriorToMove)
{
// z-order has changed - update layer set
updateMapCanvasLayerSet();
return true;
}
return false;
}
@@ -251,6 +251,9 @@ this item may be moved back to the original position with resetToInitialPosition
/**Checks mPixmapWidthValues and mPixmapHeightValues and sets a new icon size if necessary*/
void adjustIconSize();

/**This function compares the layer order before a drag with the current layer ordering and triggers a canvas repaint if it has changed*/
bool checkLayerOrderUpdate();

private slots:

/**Calls 'handleRightClickEvent' on the item*/

0 comments on commit 8d0e068

Please sign in to comment.
You can’t perform that action at this time.