Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix cad tool with escape
  • Loading branch information
vcloarec committed Apr 26, 2023
1 parent 672121d commit 93b2e27
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
Expand Up @@ -361,7 +361,7 @@ Removes previous point in the CAD point list
.. versionadded:: 3.8
%End

void updateCurrentPoint( const QgsPointXY &point );
void updateCurrentPoint( const QgsPoint &point );
%Docstring
Updates the current ``point`` in the CAD point list

Expand Down
3 changes: 2 additions & 1 deletion src/app/mesh/qgsmaptooleditmeshframe.cpp
Expand Up @@ -948,7 +948,7 @@ void QgsMapToolEditMeshFrame::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
addVertexToFaceCanditate( mCurrentVertexIndex );
// Advanced digitizing base class adds a point at map point not at vertex position
// so we need to replace it by the position of the vertex
const QgsPointXY &currentPoint = mapVertexXY( mCurrentVertexIndex );
const QgsPoint &currentPoint = mapVertex( mCurrentVertexIndex );
cadDockWidget()->updateCurrentPoint( currentPoint );
cadDockWidget()->removePreviousPoint();
cadDockWidget()->addPoint( currentPoint );
Expand Down Expand Up @@ -1236,6 +1236,7 @@ void QgsMapToolEditMeshFrame::keyPressEvent( QKeyEvent *e )
mNewFaceBand->reset( Qgis::GeometryType::Polygon );
mNewFaceCandidate.clear();
mNewVerticesForNewFaceCandidate.clear();
mCadDockWidget->clearPoints();
mCurrentState = Digitizing;
consumned = true;
}
Expand Down
6 changes: 0 additions & 6 deletions src/gui/qgsadvanceddigitizingdockwidget.cpp
Expand Up @@ -1745,12 +1745,6 @@ void QgsAdvancedDigitizingDockWidget::updateCurrentPoint( const QgsPoint &point
updateCadPaintItem();
}

void QgsAdvancedDigitizingDockWidget::updateCurrentPoint( const QgsPointXY &point )
{
updateCurrentPoint( QgsPoint( point ) );
}


void QgsAdvancedDigitizingDockWidget::CadConstraint::setLockMode( LockMode mode )
{
mLockMode = mode;
Expand Down
6 changes: 1 addition & 5 deletions src/gui/qgsadvanceddigitizingdockwidget.h
Expand Up @@ -365,7 +365,7 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
* Updates the current \a point in the CAD point list
* \since QGIS 3.30.2
*/
void updateCurrentPoint( const QgsPointXY &point );
void updateCurrentPoint( const QgsPoint &point );

/**
* Configures list of current CAD points
Expand Down Expand Up @@ -933,10 +933,6 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
*/
QList<QgsPointXY> snapSegmentToAllLayers( const QgsPointXY &originalMapPoint, bool *snapped = nullptr ) const;

//! update the current point in the CAD point list
void updateCurrentPoint( const QgsPoint &point );


/**
* filters key press
* \note called by eventFilter (filter on line edits), canvasKeyPressEvent (filter on map tool) and keyPressEvent (filter on dock)
Expand Down

0 comments on commit 93b2e27

Please sign in to comment.