我希望从 HTML5 Canvas 中使用的 JavaScript 转换语句,例如:
ctx.arc(x, y, (rad+5)*factor, 0, Math.PI*2, true);
JavaFX 中的等效语句。
它会是什么样子?
作为参考,在 HTML5 Canvas 中 arc() 方法定义为:
x The x-coordinate of the center of the circle
y The y-coordinate of the center of the circle
r The radius of the circle
sAngle The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle)
eAngle The ending angle, in radians
counterclockwise Optional. Specifies whether the drawing should be counterclockwise or clockwise. False=clockwise, true=counter-clockwise
但在 JavaFX 中它被定义为:
public void arc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double length)
Adds path elements to the current path to make an arc that uses Euclidean degrees. This Euclidean orientation sweeps from East to North, then West, then South, then back to East.
Parameters:
centerX - the center x position of the arc.
centerY - the center y position of the arc.
radiusX - the x radius of the arc.
radiusY - the y radius of the arc.
startAngle - the starting angle of the arc in the range 0-360.0
length - the length of the baseline of the arc.
有人可以向我展示 JavaFX arc() 语句的外观并解释如何在这两者之间进行转换吗?还是我应该完全使用 arcTo() 或其他东西?
谢谢。