use of javafx.scene.shape.ArcType in project processing by processing.
the class PGraphicsFX2D method arcImpl.
//////////////////////////////////////////////////////////////
// ARC
//public void arc(float a, float b, float c, float d,
// float start, float stop)
@Override
protected void arcImpl(float x, float y, float w, float h, float start, float stop, int mode) {
beforeContextDraw();
if (drawingThinLines()) {
x += 0.5f;
y += 0.5f;
}
// 0 to 90 in java would be 0 to -90 for p5 renderer
// but that won't work, so -90 to 0?
start = -start;
stop = -stop;
float sweep = stop - start;
// The defaults, before 2.0b7, were to stroke as Arc2D.OPEN, and then fill
// using Arc2D.PIE. That's a little wonky, but it's here for compatability.
// Arc2D.PIE
ArcType fillMode = ArcType.ROUND;
ArcType strokeMode = ArcType.OPEN;
if (mode == OPEN) {
fillMode = ArcType.OPEN;
} else if (mode == PIE) {
// PIE
strokeMode = ArcType.ROUND;
} else if (mode == CHORD) {
fillMode = ArcType.CHORD;
strokeMode = ArcType.CHORD;
}
if (fill) {
context.fillArc(x, y, w, h, PApplet.degrees(start), PApplet.degrees(sweep), fillMode);
}
if (stroke) {
context.strokeArc(x, y, w, h, PApplet.degrees(start), PApplet.degrees(sweep), strokeMode);
}
}
Aggregations