mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-19 00:04:52 -04:00
Fix unit tests and issues with cached layers
This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
This commit is contained in:
parent
d0fcc9557f
commit
6cc1f4c2cb
@ -203,7 +203,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin
|
|||||||
if ( mCache && ml->type() == QgsMapLayer::VectorLayer )
|
if ( mCache && ml->type() == QgsMapLayer::VectorLayer )
|
||||||
{
|
{
|
||||||
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer *>( ml );
|
QgsVectorLayer* vl = qobject_cast<QgsVectorLayer *>( ml );
|
||||||
if ( vl->isEditable() || ( labelingEngine && labelingEngine->willUseLayer( vl ) ) )
|
if ( vl->isEditable() || (( labelingEngine || labelingEngine2 ) && QgsPalLabeling::staticWillUseLayer( vl ) ) )
|
||||||
mCache->clearCacheImage( ml->id() );
|
mCache->clearCacheImage( ml->id() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2361,7 +2361,10 @@ void QgsPalLayerSettings::registerObstacleFeature( QgsFeature& f, const QgsRende
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( obstacleFeature )
|
if ( obstacleFeature )
|
||||||
|
{
|
||||||
*obstacleFeature = new QgsLabelFeature( lbl->strId(), lbl, QSizeF( 0, 0 ) );
|
*obstacleFeature = new QgsLabelFeature( lbl->strId(), lbl, QSizeF( 0, 0 ) );
|
||||||
|
( *obstacleFeature )->setIsObstacle( true );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if ( !palLayer->registerFeature( lbl->strId(), lbl, 0, 0 ) )
|
if ( !palLayer->registerFeature( lbl->strId(), lbl, 0, 0 ) )
|
||||||
return;
|
return;
|
||||||
|
@ -63,6 +63,7 @@ void QgsVectorLayerDiagramProvider::init()
|
|||||||
mPriority = 1 - mSettings.priority / 10.0; // convert 0..10 --> 1..0
|
mPriority = 1 - mSettings.priority / 10.0; // convert 0..10 --> 1..0
|
||||||
mPlacement = QgsPalLayerSettings::Placement( mSettings.placement );
|
mPlacement = QgsPalLayerSettings::Placement( mSettings.placement );
|
||||||
mLinePlacementFlags = mSettings.placementFlags;
|
mLinePlacementFlags = mSettings.placementFlags;
|
||||||
|
mFlags |= DrawAllLabels;
|
||||||
if ( mSettings.obstacle ) mFlags |= GeometriesAreObstacles;
|
if ( mSettings.obstacle ) mFlags |= GeometriesAreObstacles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
tests/testdata/labeling/pal_features_v3.sqlite
vendored
BIN
tests/testdata/labeling/pal_features_v3.sqlite
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user