ArcData
interface ArcData {
readonly startingAngle: number;
readonly endingAngle: number;
readonly innerRadius: number;
}
The ArcData property describes the radius properties of the ellipse, including startingAngle, endingAngle and innerRadius. Following is the relation between canvas and ArcData:
innerRadius is the same as the inner diameter of the panel. The startingAngle is the radian corresponding to the starting angle of the panel, and the conversion relationship between endingAngle and panel radian is radian = (endingAngle - startingAngle) / 2π * 100%
.
You can change the radian property of an ellipse to obtain the specified shape by assigning an ArcData object, e.g.
// Ring
ellipesNode.arcData = {
innerRadius: 0.5,
startingAngle: 0,
endingAngle: 2 * Math.PI,
};
// Half-circle
ellipesNode.arcData = {
innerRadius: 0,
startingAngle: 0,
endingAngle: Math.PI,
};