Skip to content
Permalink
Browse files

fix double

  • Loading branch information
lbartoletti authored and nyalldawson committed Jul 16, 2018
1 parent 72a7360 commit 8edfaa7b37301e1f971e696e236398467ac2cc0e
@@ -55,7 +55,7 @@ The QgsCadUtils class provides routines for CAD editing.

QgsPointLocator::Match edgeMatch;

int softLockCommonAngle;
double softLockCommonAngle;
};

static QgsCadUtils::AlignMapPointOutput alignMapPoint( const QgsPointXY &originalMapPoint, const QgsCadUtils::AlignMapPointContext &ctx );
@@ -96,7 +96,7 @@ class CORE_EXPORT QgsCadUtils
QgsPointLocator::Match edgeMatch;

//! Angle (in degrees) to which we have soft-locked ourselves (if not set it is -1)
int softLockCommonAngle;
double softLockCommonAngle;
};

/**
@@ -38,7 +38,13 @@
QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas *canvas, QWidget *parent )
: QgsDockWidget( parent )
, mMapCanvas( canvas )
, mCommonAngleConstraint( QgsSettings().value( QStringLiteral( "/Cad/CommonAngle" ), 90 ).toInt() )
, mCurrentMapToolSupportsCad( false )
, mCadEnabled( false )
, mConstructionMode( false )
, mCommonAngleConstraint( QgsSettings().value( QStringLiteral( "/Cad/CommonAngle" ), 90 ).toDouble() )
, mSnappedToVertex( false )
, mSessionActive( false )
, mErrorMessage( nullptr )
{
setupUi( this );

@@ -113,7 +119,7 @@ QgsAdvancedDigitizingDockWidget::QgsAdvancedDigitizingDockWidget( QgsMapCanvas *
commonAngles << QPair<double, QString>( 30, tr( "Snap to 30° angles" ) );
commonAngles << QPair<double, QString>( 45, tr( "Snap to 45° angles" ) );
commonAngles << QPair<double, QString>( 90, tr( "Snap to 90° angles" ) );
for ( QList< QPair<double , QString > >::const_iterator it = commonAngles.constBegin(); it != commonAngles.constEnd(); ++it )
for ( QList< QPair<double, QString > >::const_iterator it = commonAngles.constBegin(); it != commonAngles.constEnd(); ++it )
{
QAction *action = new QAction( it->second, menu );
action->setCheckable( true );
@@ -252,7 +252,7 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
//! Constraint on the Y coordinate
const CadConstraint *constraintY() const { return mYConstraint.get(); }
//! Constraint on a common angle
bool commonAngleConstraint() const { return mCommonAngleConstraint; }
bool commonAngleConstraint() const { return !qgsDoubleNear( mCommonAngleConstraint, 0.0 ); }

/**
* Removes all points from the CAD point list
@@ -467,7 +467,7 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
std::unique_ptr< CadConstraint > mXConstraint;
std::unique_ptr< CadConstraint > mYConstraint;
AdditionalConstraint mAdditionalConstraint;
int mCommonAngleConstraint = 90; // if 0: do not snap to common angles
double mCommonAngleConstraint; // if 0: do not snap to common angles

// point list and current snap point / segment
QList<QgsPointXY> mCadPointList;
@@ -481,7 +481,7 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private

// UI
QAction *mEnableAction = nullptr;
QMap< QAction *, int > mCommonAngleActions; // map the common angle actions with their angle values
QMap< QAction *, double > mCommonAngleActions; // map the common angle actions with their angle values

private:
#ifdef SIP_RUN

0 comments on commit 8edfaa7

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