arrows fixed + colors
This commit is contained in:
@@ -24,20 +24,22 @@ class Graph {
|
||||
|
||||
void draw_points(int point_weight) {
|
||||
strokeWeight(point_weight);
|
||||
stroke(#FF0000);
|
||||
stroke(255);
|
||||
for (int i = 0; i < coords.size(); i++) {
|
||||
point(coords.get(i).get(0), coords.get(i).get(1));
|
||||
text(i+1, coords.get(i).get(0)-3, coords.get(i).get(1)+5);
|
||||
textAlign(CENTER, CENTER);
|
||||
fill(0);
|
||||
text(i+1, coords.get(i).get(0), coords.get(i).get(1));
|
||||
}
|
||||
}
|
||||
|
||||
void draw_graph(int graph_weight, int point_weight) {
|
||||
stroke(#550000);
|
||||
strokeWeight(10);
|
||||
stroke(255);
|
||||
strokeWeight(graph_weight);
|
||||
for (int i = 0; i < adj.size(); i++) {
|
||||
for (int idx = 0; idx < adj.get(i).size(); idx++) {
|
||||
int e = adj.get(i).get(idx);
|
||||
draw_arrow(coords.get(i).get(0), coords.get(i).get(1), coords.get(e).get(0), coords.get(e).get(1), point_weight, graph_weight);
|
||||
draw_arrow(coords.get(i).get(0), coords.get(i).get(1), coords.get(e).get(0), coords.get(e).get(1), point_weight, graph_weight, 15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user