Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix setting a layer to act as a label obstacle does not stick
  • Loading branch information
nyalldawson committed Feb 15, 2016
1 parent 59b216b commit 6f2d11b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/qgslabelingwidget.cpp
Expand Up @@ -97,7 +97,10 @@ void QgsLabelingWidget::labelModeChanged( int index )
if ( QgsLabelingGui* widgetSimple = qobject_cast<QgsLabelingGui*>( mWidget ) )
{
// lighter variant - just change the mode of existing widget
widgetSimple->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );
if ( index == 3 )
widgetSimple->setLabelMode( QgsLabelingGui::ObstaclesOnly );
else
widgetSimple->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );
return;
}
}
Expand All @@ -117,7 +120,12 @@ void QgsLabelingWidget::labelModeChanged( int index )
else
{
QgsLabelingGui* w = new QgsLabelingGui( mLayer, mCanvas, nullptr, this );
w->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );

if ( index == 3 )
w->setLabelMode( QgsLabelingGui::ObstaclesOnly );
else
w->setLabelMode( static_cast< QgsLabelingGui::LabelMode >( index ) );

w->init();
mWidget = w;
}
Expand Down

0 comments on commit 6f2d11b

Please sign in to comment.