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

Method parseEllipse

core/src/processing/core/PShapeSVG.java:420–440  ·  view source on GitHub ↗

Handles parsing ellipse and circle tags. @param circle true if this is a circle and not an ellipse

(boolean circle)

Source from the content-addressed store, hash-verified

418 * @param circle true if this is a circle and not an ellipse
419 */
420 protected void parseEllipse(boolean circle) {
421 kind = ELLIPSE;
422 family = PRIMITIVE;
423 params = new float[4];
424
425 params[0] = getFloatWithUnit(element, "cx", svgWidth);
426 params[1] = getFloatWithUnit(element, "cy", svgHeight);
427
428 float rx, ry;
429 if (circle) {
430 rx = ry = getFloatWithUnit(element, "r", svgSizeXY);
431 } else {
432 rx = getFloatWithUnit(element, "rx", svgWidth);
433 ry = getFloatWithUnit(element, "ry", svgHeight);
434 }
435 params[0] -= rx;
436 params[1] -= ry;
437
438 params[2] = rx*2;
439 params[3] = ry*2;
440 }
441
442
443 protected void parseRect() {

Callers 1

parseChildMethod · 0.95

Calls 1

getFloatWithUnitMethod · 0.95

Tested by

no test coverage detected