Skip to content

Commit 9fcacef

Browse files
committed
Renamed primitive to kind
1 parent 08495cd commit 9fcacef

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

core/src/processing/core/PShape.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class PShape implements PConstants {
9393
protected int family;
9494

9595
/** ELLIPSE, LINE, QUAD; TRIANGLE_FAN, QUAD_STRIP; etc. */
96-
protected int primitive;
96+
protected int kind;
9797

9898
protected PMatrix matrix;
9999

@@ -497,10 +497,10 @@ protected void drawGroup(PGraphics g) {
497497

498498

499499
protected void drawPrimitive(PGraphics g) {
500-
if (primitive == POINT) {
500+
if (kind == POINT) {
501501
g.point(params[0], params[1]);
502502

503-
} else if (primitive == LINE) {
503+
} else if (kind == LINE) {
504504
if (params.length == 4) { // 2D
505505
g.line(params[0], params[1],
506506
params[2], params[3]);
@@ -509,18 +509,18 @@ protected void drawPrimitive(PGraphics g) {
509509
params[3], params[4], params[5]);
510510
}
511511

512-
} else if (primitive == TRIANGLE) {
512+
} else if (kind == TRIANGLE) {
513513
g.triangle(params[0], params[1],
514514
params[2], params[3],
515515
params[4], params[5]);
516516

517-
} else if (primitive == QUAD) {
517+
} else if (kind == QUAD) {
518518
g.quad(params[0], params[1],
519519
params[2], params[3],
520520
params[4], params[5],
521521
params[6], params[7]);
522522

523-
} else if (primitive == RECT) {
523+
} else if (kind == RECT) {
524524
if (image != null) {
525525
g.imageMode(CORNER);
526526
g.image(image, params[0], params[1], params[2], params[3]);
@@ -529,22 +529,22 @@ protected void drawPrimitive(PGraphics g) {
529529
g.rect(params[0], params[1], params[2], params[3]);
530530
}
531531

532-
} else if (primitive == ELLIPSE) {
532+
} else if (kind == ELLIPSE) {
533533
g.ellipseMode(CORNER);
534534
g.ellipse(params[0], params[1], params[2], params[3]);
535535

536-
} else if (primitive == ARC) {
536+
} else if (kind == ARC) {
537537
g.ellipseMode(CORNER);
538538
g.arc(params[0], params[1], params[2], params[3], params[4], params[5]);
539539

540-
} else if (primitive == BOX) {
540+
} else if (kind == BOX) {
541541
if (params.length == 1) {
542542
g.box(params[0]);
543543
} else {
544544
g.box(params[0], params[1], params[2]);
545545
}
546546

547-
} else if (primitive == SPHERE) {
547+
} else if (kind == SPHERE) {
548548
g.sphere(params[0]);
549549
}
550550
}
@@ -554,7 +554,7 @@ protected void drawGeometry(PGraphics g) {
554554
// get cache object using g.
555555

556556

557-
g.beginShape(primitive);
557+
g.beginShape(kind);
558558
if (style) {
559559
for (int i = 0; i < vertexCount; i++) {
560560
g.vertex(vertices[i]);
@@ -905,7 +905,7 @@ public int getFamily() {
905905

906906

907907
public int getPrimitive() {
908-
return primitive;
908+
return kind;
909909
}
910910

911911

core/src/processing/core/PShapeSVG.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ protected PShape parseChild(XML elem) {
414414

415415

416416
protected void parseLine() {
417-
primitive = LINE;
417+
kind = LINE;
418418
family = PRIMITIVE;
419419
params = new float[] {
420420
getFloatWithUnit(element, "x1"),
@@ -430,7 +430,7 @@ protected void parseLine() {
430430
* @param circle true if this is a circle and not an ellipse
431431
*/
432432
protected void parseEllipse(boolean circle) {
433-
primitive = ELLIPSE;
433+
kind = ELLIPSE;
434434
family = PRIMITIVE;
435435
params = new float[4];
436436

@@ -453,7 +453,7 @@ protected void parseEllipse(boolean circle) {
453453

454454

455455
protected void parseRect() {
456-
primitive = RECT;
456+
kind = RECT;
457457
family = PRIMITIVE;
458458
params = new float[] {
459459
getFloatWithUnit(element, "x"),
@@ -488,7 +488,7 @@ protected void parsePoly(boolean close) {
488488

489489
protected void parsePath() {
490490
family = PATH;
491-
primitive = 0;
491+
kind = 0;
492492

493493
String pathData = element.getString("d");
494494
if (pathData == null || PApplet.trim(pathData).length() == 0) {

0 commit comments

Comments
 (0)