This commit is contained in:
hm
2020-12-07 16:29:08 +08:00
parent d9ecddfd10
commit f0793bde7b
18 changed files with 1538 additions and 1134 deletions
+14 -6
View File
@@ -329,7 +329,7 @@ void OPMapWidget::WPLineDelete(WayPointItem *from, WayPointItem *to)
{
break;
}
}while(1);
}while(0);
}
WayPointLine *OPMapWidget::WPLineFind(WayPointItem *from, WayPointItem *to)
@@ -1212,12 +1212,20 @@ void OPMapWidget::WPLocalChanged(QPointF p, WayPointItem *w)
void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *w)
{
int Point_Count = 0;
foreach(QGraphicsItem * i, map->childItems()) {
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
if (w) {//逐渐往下增加
Point_Count++;
}
}
if(flag)
{
WayPointItem *item = WPFind(w->Number() - 1);
if(item)
{
WPLineDelete(item,w);
//跟随上一点的位置
@@ -1245,7 +1253,7 @@ void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *w)
{
break;
}
}while(1);
}while(front_seq > 0);
WayPointItem *next_item;
int next_seq = w->Number();
@@ -1269,7 +1277,7 @@ void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *w)
{
break;
}
}while(1);
}while(next_seq <= Point_Count);
if(next_item)
{
@@ -1310,7 +1318,7 @@ void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *w)
{
break;
}
}while(1);
}while(front_seq > 0);
WayPointItem *next_item;
int next_seq = w->Number()+1;
@@ -1332,7 +1340,7 @@ void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *w)
{
break;
}
}while(1);
}while(next_seq <= Point_Count);
if((front_item)&&(next_item))
{