Skip to content

Commit

Permalink
Fix move feature(s) action
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jul 4, 2023
1 parent 07efb8f commit 94bea7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/core/utils/geometryutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ class QFIELD_CORE_EXPORT GeometryUtils : public QObject

//! Returns an empty (i.e. null) point
static Q_INVOKABLE QgsPoint emptyPoint() { return QgsPoint(); }

//! Returns an point
static Q_INVOKABLE QgsPoint point( const double &x, const double &y ) { return QgsPoint( x, y ); }
};

#endif // GEOMETRYUTILS_H
8 changes: 4 additions & 4 deletions src/qml/qgismobileapp.qml
Original file line number Diff line number Diff line change
Expand Up @@ -1858,15 +1858,15 @@ ApplicationWindow {
id: moveFeaturesToolbar

property bool moveFeaturesRequested: false
property variant startPoint: undefined // QgsPoint or undefined
property variant endPoint: undefined // QgsPoint or undefined
property var startPoint: undefined // QgsPoint or undefined
property var endPoint: undefined // QgsPoint or undefined
signal moveConfirmed
signal moveCanceled

stateVisible: moveFeaturesRequested

onConfirm: {
endPoint = mapCanvas.mapSettings.center
endPoint = GeometryUtils.point(mapCanvas.mapSettings.center.x, mapCanvas.mapSettings.center.y)
moveFeaturesRequested = false
moveConfirmed()
}
Expand All @@ -1882,7 +1882,7 @@ ApplicationWindow {
featureForm.extentController.zoomToSelected()
}

startPoint = mapCanvas.mapSettings.center
startPoint = GeometryUtils.point(mapCanvas.mapSettings.center.x, mapCanvas.mapSettings.center.y)
moveFeaturesRequested = true
}
}
Expand Down

0 comments on commit 94bea7e

Please sign in to comment.