I use following code to replace a list's elements. After replace elements aren't in the same order in the edges list, than in myCoordinates list. Is it maybe some randomness or what causes the change of its sequence?
for (int i = 0; i < edges.size(); i++) {
int j = i*4;
Edge edge = edges.get(i);
edge.p1.x = myCoordinates.get(j);
edge.p1.y = myCoordinates.get(j+1);
edge.p2.x = myCoordinates.get(j+2);
edge.p2.y = myCoordinates.get(j+3);
}
Aucun commentaire:
Enregistrer un commentaire