|
@@ -486,8 +486,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (deletePoint && tempP.getX() != 0
|
|
|
- && (tempP.getX() != this.getWidth() / scaleX || tempP != pointList.getLast())) {
|
|
|
+ if (deletePoint && tempP != pointList.getFirst() && tempP != pointList.getLast()) {
|
|
|
int i = pointList.indexOf(tempP);
|
|
|
|
|
|
if (tempP.getY() == (int) (height / 6) && i < pointList.size() - 1 && i > 0) {
|
|
@@ -579,7 +578,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
|
|
|
pointList.removeAll(pointList);
|
|
|
if (isSwitch) {
|
|
|
pointList.addFirst(new Point(-border, (int) (height / 6)));
|
|
|
- pointList.addLast(new Point((int) (width) + 4, (int) (height / 6)));
|
|
|
+ pointList.addLast(new Point((int) ((this.getWidth()) / scaleX), (int) (height / 6)));
|
|
|
} else {
|
|
|
pointList.addFirst(new Point(0, 0));
|
|
|
pointList.addLast(new Point((int) ((this.getWidth() - (border * 2)) / scaleX), 0));
|
|
@@ -644,7 +643,7 @@ public class UnitGraph extends JPanel implements MouseListener, MouseMotionListe
|
|
|
|
|
|
if (pointList.isEmpty()) {
|
|
|
pointList.addFirst(new Point(-border, (int) (height / 6)));
|
|
|
- pointList.addLast(new Point((int) ((this.getWidth() - border) / scaleX), (int) (height / 6)));
|
|
|
+ pointList.addLast(new Point((int) ((this.getWidth()) / scaleX), (int) (height / 6)));
|
|
|
}
|
|
|
repaint();
|
|
|
}
|