Skip to content
Snippets Groups Projects
Commit 34860f56 authored by IDante's avatar IDante
Browse files

Fix 3

parent 5ddb7590
No related merge requests found
......@@ -28,7 +28,6 @@ public class Main extends JFrame {
double mouseY = e.getY();
if (SwingUtilities.isRightMouseButton(e)) {
// Remove the closest control point when right-clicked
removeClosestControlPoint(mouseX, mouseY);
} else {
for (Point2D.Double point : controlPoints) {
......@@ -61,7 +60,6 @@ public class Main extends JFrame {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
// Draw control points
g2d.setColor(Color.RED);
for (Point2D.Double point : controlPoints) {
int x = (int) point.getX();
......@@ -69,7 +67,6 @@ public class Main extends JFrame {
g2d.fillOval(x - 5, y - 5, 10, 10);
}
// Draw Bezier curve
g2d.setColor(Color.BLUE);
g2d.setStroke(new BasicStroke(2));
int numSegments = 100;
......@@ -129,7 +126,6 @@ public class Main extends JFrame {
controlPoints.remove(closestPoint);
}
// Clear all points if fewer than 4 points are left
if (controlPoints.size() < 4) {
controlPoints.clear();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment