MCPcopy Index your code
hub / github.com/benfry/processing4 / arcImpl

Method arcImpl

core/src/processing/awt/PGraphicsJava2D.java:1265–1314  ·  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

1263
1264
1265 @Override
1266 protected void arcImpl(float x, float y, float w, float h,
1267 float start, float stop, int mode) {
1268 // 0 to 90 in java would be 0 to -90 for p5 renderer
1269 // but that won't work, so -90 to 0?
1270
1271 start = -start * RAD_TO_DEG;
1272 stop = -stop * RAD_TO_DEG;
1273
1274 // ok to do this because already checked for NaN
1275// while (start < 0) {
1276// start += 360;
1277// stop += 360;
1278// }
1279// if (start > stop) {
1280// float temp = start;
1281// start = stop;
1282// stop = temp;
1283// }
1284 float sweep = stop - start;
1285
1286 // The defaults, before 2.0b7, were to stroke as Arc2D.OPEN, and then fill
1287 // using Arc2D.PIE. That's a little wonky, but it's here for compatability.
1288 int fillMode = Arc2D.PIE;
1289 int strokeMode = Arc2D.OPEN;
1290
1291 if (mode == OPEN) {
1292 fillMode = Arc2D.OPEN;
1293 //strokeMode = Arc2D.OPEN;
1294
1295 } else if (mode == PIE) {
1296 //fillMode = Arc2D.PIE;
1297 strokeMode = Arc2D.PIE;
1298
1299 } else if (mode == CHORD) {
1300 fillMode = Arc2D.CHORD;
1301 strokeMode = Arc2D.CHORD;
1302 }
1303
1304 if (fill) {
1305 //System.out.println("filla");
1306 arc.setArc(x, y, w, h, start, sweep, fillMode);
1307 fillShape(arc);
1308 }
1309 if (stroke) {
1310 //System.out.println("strokey");
1311 arc.setArc(x, y, w, h, start, sweep, strokeMode);
1312 strokeShape(arc);
1313 }
1314 }
1315
1316
1317

Callers

nothing calls this directly

Calls 2

fillShapeMethod · 0.95
strokeShapeMethod · 0.95

Tested by

no test coverage detected