Skip to content

Commit

Permalink
fix #38872
Browse files Browse the repository at this point in the history
  • Loading branch information
vcloarec authored and nyalldawson committed Sep 21, 2020
1 parent ca6ffb7 commit 0fb54bc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/app/qgisapp.cpp
Expand Up @@ -10087,17 +10087,18 @@ void QgisApp::enableDigitizeWithCurveAction( bool enable )
QgsSettings settings;

QObject *sender = QObject::sender();
if ( sender && sender != this )
enable &= ( sender == mActionAddFeature && mMapTools.mAddFeature->mode() != QgsMapToolCapture::CapturePoint ) ||
sender == mActionSplitFeatures;
else
enable &= ( mMapCanvas->mapTool() == mMapTools.mAddFeature && mMapTools.mAddFeature->mode() != QgsMapToolCapture::CapturePoint ) ||
mMapCanvas->mapTool() == mMapTools.mSplitFeatures;

enable &= ( sender == mActionAddFeature && mMapTools.mAddFeature->mode() != QgsMapToolCapture::CapturePoint ) ||
( mMapCanvas->mapTool() == mMapTools.mAddFeature && mMapTools.mAddFeature->mode() != QgsMapToolCapture::CapturePoint ) ||
sender == mActionSplitFeatures ||
mMapCanvas->mapTool() == mMapTools.mSplitFeatures;

bool isChecked = settings.value( QStringLiteral( "UI/digitizeWithCurve" ) ).toInt() && enable;
mActionDigitizeWithCurve->setChecked( isChecked );

mActionDigitizeWithCurve->setEnabled( enable );

mMapTools.mAddFeature->setCircularDigitizingEnabled( isChecked );
static_cast<QgsMapToolCapture *>( mMapTools.mSplitFeatures )->setCircularDigitizingEnabled( isChecked );
}

void QgisApp::splitFeatures()
Expand Down

0 comments on commit 0fb54bc

Please sign in to comment.