DbViewer: Updated add constraint order (from=old, to=newer)

This commit is contained in:
matlabbe
2020-04-08 18:52:38 -04:00
parent 7e8e80db2c
commit 82a19a2ff1
+5 -1
View File
@@ -7088,7 +7088,7 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
UWARN("Cannot add link to same node");
return false;
}
else if(from < to)
else if(from > to)
{
switchedIds = true;
int tmp = from;
@@ -7398,6 +7398,10 @@ bool DatabaseViewer::addConstraint(int from, int to, bool silent)
}
else
{
if(newLink.from() < newLink.to())
{
newLink = newLink.inverse();
}
linksAdded_.insert(std::make_pair(newLink.from(), newLink));
}
if(!silent)