Skip to content
Permalink
Browse files

Fix vector layer editation when symbology-ng is turned on.

git-svn-id: http://svn.osgeo.org/qgis/trunk@12194 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Nov 19, 2009
1 parent 19661d6 commit de166f6c3bd9295180e223083ff2a53c00fd8f5f
Showing with 25 additions and 6 deletions.
  1. +25 −6 src/core/qgsvectorlayer.cpp
@@ -315,10 +315,10 @@ void QgsVectorLayer::drawLabels( QgsRenderContext& rendererContext )
{
QgsDebugMsg( "Starting draw of labels" );

if ( ( mRenderer || mRendererV2 ) && mLabelOn &&
( !label()->scaleBasedVisibility() ||
( label()->minScale() <= rendererContext.rendererScale() &&
rendererContext.rendererScale() <= label()->maxScale() ) ) )
if (( mRenderer || mRendererV2 ) && mLabelOn &&
( !label()->scaleBasedVisibility() ||
( label()->minScale() <= rendererContext.rendererScale() &&
rendererContext.rendererScale() <= label()->maxScale() ) ) )
{
QgsAttributeList attributes;
if ( mRenderer )
@@ -352,8 +352,8 @@ void QgsVectorLayer::drawLabels( QgsRenderContext& rendererContext )
QgsFeature fet;
while ( nextFeature( fet ) )
{
if ( ( mRenderer && mRenderer->willRenderFeature( &fet ) )
|| ( mRendererV2 && mRendererV2->symbolForFeature( fet ) != NULL ) )
if (( mRenderer && mRenderer->willRenderFeature( &fet ) )
|| ( mRendererV2 && mRendererV2->symbolForFeature( fet ) != NULL ) )
{
bool sel = mSelectedFeatureIds.contains( fet.id() );
mLabel->renderLabel( rendererContext, fet, sel, 0 );
@@ -706,6 +706,12 @@ void QgsVectorLayer::drawRendererV2( QgsRenderContext& rendererContext, bool lab

if ( labeling )
rendererContext.labelingEngine()->registerFeature( this, fet );

if ( mEditable )
{
// Cache this for the use of (e.g.) modifying the feature's uncommitted geometry.
mCachedGeometries[fet.id()] = *fet.geometry();
}
}

mRendererV2->stopRender( rendererContext );
@@ -745,6 +751,12 @@ void QgsVectorLayer::drawRendererV2Levels( QgsRenderContext& rendererContext, bo

if ( labeling )
rendererContext.labelingEngine()->registerFeature( this, fet );

if ( mEditable )
{
// Cache this for the use of (e.g.) modifying the feature's uncommitted geometry.
mCachedGeometries[fet.id()] = *fet.geometry();
}
}

// find out the order
@@ -806,6 +818,13 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )

QgsDebugMsg( "rendering v2:\n" + mRendererV2->dump() );

if ( mEditable )
{
// Destroy all cached geometries and clear the references to them
deleteCachedGeometries();
mCachedGeometriesRect = rendererContext.extent();
}

// TODO: really needed?
updateFeatureCount();

0 comments on commit de166f6

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