Is there any way in JavaFX to get the x,y coordinates of the path i draw on screen on a Canvas?
I have an app that draw some Circles on a Canvas and then it connects the Circles with Lines.
After that i can change the positions of the Circles by dragging the nodes and the program is always redrawing the Lines between the Circles on the Canvas
But now i want to draw a a QuadCurve between those Circles.
public void drawQuadCurveOnCanvas(double startX, double startY, double endX, double endY, double controlX, double controlY) {
// Set line width
lineDraw.setLineWidth(Constants.LINE_THICKNESS);
// Set the Color
lineDraw.setStroke(Constants.DRAG_COLOR);
// Start the Path
lineDraw.beginPath();
lineDraw.moveTo(startX, startY);
lineDraw.quadraticCurveTo(controlX, controlY, endX, endY);
// Draw the Path
lineDraw.stroke();
}
I draw the QuadCurve with one of the Circles as the control point and other two Circles as the start and end coordinates.
So i wanted to get the x,y coordinates along the QuadCurve i just draw so i can create some Circles on those coordinates and after that when i connect those Circles with Lines i get the same QuadCurve.
I don't know if i explained myself well, anyone with any idea how to accomplish what i want?