Browse Source

Fixed the last node in a UnitGraph being possible to delete.

Ludwig Tietze 6 years ago
parent
commit
7f5d41ce72
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/ui/view/UnitGraph.java

+ 2 - 2
src/ui/view/UnitGraph.java

@@ -383,7 +383,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
             for (Point p : pointList) {
                 if (x >= p.getX() - recSize.getX() / 2 && y >= p.getY() - recSize.getY() / 2
                         && x <= p.getX() + recSize.getX() / 2 && y <= p.getY() * scaleY + recSize.getY() / 2) {
-                    if (e.getButton() == MouseEvent.BUTTON3) {
+                    if (e.getButton() == MouseEvent.BUTTON3) {//TODO: test
                         tempP = p;
                         deletePoint = true;
                     } else {
@@ -414,7 +414,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
             }
             // Delete a Point
             if (deletePoint && tempP.getX() != 0
-                    && (tempP.getX() != this.getWidth() / scaleX || tempP != pointList.getLast())) {
+                    && /*(*//*tempP.getX() != this.getWidth() / scaleX || */tempP != pointList.getLast())/*)*/ {
                 pointList.remove(tempP);
             }