Skip to content

Commit

Permalink
Merge pull request mavlink#6769 from DonLakeFlyer/RadiusUnits
Browse files Browse the repository at this point in the history
Polygon Circle: Respect app units
  • Loading branch information
DonLakeFlyer authored Aug 6, 2018
2 parents dda077e + 7d25e16 commit f8f4d5e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/MissionManager/QGCMapPolygonVisuals.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Item {
_circle = false
}

/// Reset polygon to a circle which fits within initial polygon
function setCircleRadius(center, radius) {
var unboundCenter = center.atDistanceAndAzimuth(0, 0)
_circleRadius = radius
Expand Down Expand Up @@ -460,7 +459,8 @@ Item {
}

function setRadiusFromDialog() {
setCircleRadius(mapPolygon.center, radiusField.text)
var radius = QGroundControl.appSettingsDistanceUnitsToMeters(radiusField.text)
setCircleRadius(mapPolygon.center, radius)
_editCircleRadius = false
}

Expand All @@ -484,7 +484,9 @@ Item {

QGCTextField {
id: radiusField
text: _circleRadius.toFixed(2)
showUnits: true
unitsLabel: QGroundControl.appSettingsDistanceUnitsString
text: QGroundControl.metersToAppSettingsDistanceUnits(_circleRadius).toFixed(2)
onEditingFinished: setRadiusFromDialog()
inputMethodHints: Qt.ImhFormattedNumbersOnly
}
Expand Down

0 comments on commit f8f4d5e

Please sign in to comment.