Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
52594677
Commit
52594677
authored
Dec 08, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2369 from DonLakeFlyer/LiveDrag
Continuous drag of mission items
parents
cc5689ba
894b21c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
79 deletions
+17
-79
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+17
-79
No files found.
src/MissionEditor/MissionEditor.qml
View file @
52594677
...
...
@@ -195,20 +195,29 @@ QGCView {
id
:
itemDragger
x
:
missionItemIndicator
?
(
missionItemIndicator
.
x
+
missionItemIndicator
.
anchorPoint
.
x
-
(
itemDragger
.
width
/
2
))
:
100
y
:
missionItemIndicator
?
(
missionItemIndicator
.
y
+
missionItemIndicator
.
anchorPoint
.
y
-
(
itemDragger
.
height
/
2
))
:
100
width
:
_radius
*
2
height
:
_radius
*
2
//radius: _radius
//border.width: 2
//border.color: "white"
width
:
ScreenTools
.
defaultFontPixelHeight
*
2
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
color
:
"
transparent
"
visible
:
false
z
:
QGroundControl
.
zOrderMapItems
+
1
// Above item icons
property
var
missionItem
property
var
missionItemIndicator
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelHeight
*
4
readonly
property
real
_arrowHeight
:
ScreenTools
.
defaultFontPixelHeight
property
bool
preventCoordinateBindingLoop
:
false
onXChanged
:
liveDrag
()
onYChanged
:
liveDrag
()
function
liveDrag
()
{
if
(
!
itemDragger
.
preventCoordinateBindingLoop
&&
Drag
.
active
)
{
var
point
=
Qt
.
point
(
itemDragger
.
x
+
(
itemDragger
.
width
/
2
),
itemDragger
.
y
+
(
itemDragger
.
height
/
2
))
var
coordinate
=
editorMap
.
toCoordinate
(
point
)
coordinate
.
altitude
=
itemDragger
.
missionItem
.
coordinate
.
altitude
itemDragger
.
preventCoordinateBindingLoop
=
true
itemDragger
.
missionItem
.
coordinate
=
coordinate
itemDragger
.
preventCoordinateBindingLoop
=
false
}
}
function
clearItem
()
{
itemDragger
.
visible
=
false
...
...
@@ -216,64 +225,6 @@ QGCView {
itemDragger
.
missionItemIndicator
=
undefined
}
Image
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.top
:
parent
.
top
height
:
parent
.
_arrowHeight
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
source
:
"
/qmlimages/ArrowHead.svg
"
}
Image
{
id
:
arrowUp
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
height
:
parent
.
_arrowHeight
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
source
:
"
/qmlimages/ArrowHead.svg
"
transform
:
Rotation
{
origin.x
:
arrowUp
.
width
/
2
;
origin.y
:
arrowUp
.
height
/
2
;
angle
:
90
}
}
Image
{
id
:
arrowDown
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.bottom
:
parent
.
bottom
height
:
parent
.
_arrowHeight
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
source
:
"
/qmlimages/ArrowHead.svg
"
transform
:
Rotation
{
origin.x
:
arrowDown
.
width
/
2
;
origin.y
:
arrowDown
.
height
/
2
;
angle
:
180
}
}
Image
{
id
:
arrowLeft
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.left
:
parent
.
left
height
:
parent
.
_arrowHeight
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
source
:
"
/qmlimages/ArrowHead.svg
"
transform
:
Rotation
{
origin.x
:
arrowLeft
.
width
/
2
;
origin.y
:
arrowLeft
.
height
/
2
;
angle
:
-
90
}
}
Rectangle
{
width
:
_radius
*
2
height
:
_radius
*
2
radius
:
_radius
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
border.width
:
1
border.color
:
"
white
"
readonly
property
real
_radius
:
ScreenTools
.
defaultFontPixelWidth
/
4
}
Drag.active
:
itemDrag
.
drag
.
active
Drag.hotSpot.x
:
width
/
2
Drag.hotSpot.y
:
height
/
2
...
...
@@ -286,19 +237,6 @@ QGCView {
drag.minimumY
:
0
drag.maximumX
:
itemDragger
.
parent
.
width
-
parent
.
width
drag.maximumY
:
itemDragger
.
parent
.
height
-
parent
.
height
property
bool
dragActive
:
drag
.
active
onDragActiveChanged
:
{
if
(
!
drag
.
active
)
{
var
point
=
Qt
.
point
(
itemDragger
.
x
+
(
itemDragger
.
width
/
2
),
itemDragger
.
y
+
(
itemDragger
.
height
/
2
))
var
coordinate
=
editorMap
.
toCoordinate
(
point
)
coordinate
.
altitude
=
itemDragger
.
missionItem
.
coordinate
.
altitude
itemDragger
.
missionItem
.
coordinate
=
coordinate
editorMap
.
latitude
=
itemDragger
.
missionItem
.
coordinate
.
latitude
editorMap
.
longitude
=
itemDragger
.
missionItem
.
coordinate
.
longitude
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment