Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed infinite loop when clicking point 2 times in a row
  • Loading branch information
cor11004 committed Dec 7, 2015
1 parent 712639b commit 462e5c0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions main/main.pde
Expand Up @@ -9,7 +9,8 @@ public void setup() {
background(255);
fill(0,0);
translate(width/2, height/2);
Point p1 = new Point(0, 0);

/*Point p1 = new Point(0, 0);
list.addPoint(p1);
Point p2 = new Point(100, 50);
list.addPoint(p2);
Expand Down Expand Up @@ -58,7 +59,7 @@ public void setup() {
HalfEdge h13 = new HalfEdge(p7, p15);
HalfEdge h14 = new HalfEdge(p8, p15);
HalfEdge h15 = new HalfEdge(p9, p15);
HalfEdge h16 = new HalfEdge(p16, p17);
HalfEdge h16 = new HalfEdge(p16, p17); */

//h1.printFace();
//float f = CompGeo.signedArea(h1.gettwin());
Expand Down Expand Up @@ -98,8 +99,12 @@ void mouseReleased() {
for(Point p: list.getPoints()) {
if((p.getX() - 10 < x) && (p.getX() + + 10 > x)) {
if((p.getY() - 10 < y) && (p.getY() + 10 > y)) {
HalfEdge h = new HalfEdge(p, pointclicked);
linedrawn = true;
if(p.getY() - 10 < pointclicked.getY() && p.getY() + 10 > pointclicked.getY()
&& p.getX() - 10 < pointclicked.getX() && p.getX() + 10 > pointclicked.getX()) { }
else {
HalfEdge h = new HalfEdge(p, pointclicked);
}
}
}
}
Expand Down

0 comments on commit 462e5c0

Please sign in to comment.