MCPcopy Index your code
hub / github.com/processing/processing / arcImpl

Method arcImpl

core/src/processing/javafx/PGraphicsFX2D.java:818–857  ·  view source on GitHub ↗
(float x, float y, float w, float h,
                         float start, float stop, int mode)

Source from the content-addressed store, hash-verified

816
817
818 @Override
819 protected void arcImpl(float x, float y, float w, float h,
820 float start, float stop, int mode) {
821 beforeContextDraw();
822
823 if (drawingThinLines()) {
824 x += 0.5f;
825 y += 0.5f;
826 }
827
828 // 0 to 90 in java would be 0 to -90 for p5 renderer
829 // but that won't work, so -90 to 0?
830 start = -start;
831 stop = -stop;
832
833 float sweep = stop - start;
834
835 // The defaults, before 2.0b7, were to stroke as Arc2D.OPEN, and then fill
836 // using Arc2D.PIE. That's a little wonky, but it's here for compatability.
837 ArcType fillMode = ArcType.ROUND; // Arc2D.PIE
838 ArcType strokeMode = ArcType.OPEN;
839
840 if (mode == OPEN) {
841 fillMode = ArcType.OPEN;
842
843 } else if (mode == PIE) {
844 strokeMode = ArcType.ROUND; // PIE
845
846 } else if (mode == CHORD) {
847 fillMode = ArcType.CHORD;
848 strokeMode = ArcType.CHORD;
849 }
850
851 if (fill) {
852 context.fillArc(x, y, w, h, PApplet.degrees(start), PApplet.degrees(sweep), fillMode);
853 }
854 if (stroke) {
855 context.strokeArc(x, y, w, h, PApplet.degrees(start), PApplet.degrees(sweep), strokeMode);
856 }
857 }
858
859
860

Callers

nothing calls this directly

Calls 3

beforeContextDrawMethod · 0.95
drawingThinLinesMethod · 0.95
degreesMethod · 0.95

Tested by

no test coverage detected