Skip to content

Commit 494ac5d

Browse files
committed
added circle, square, push, pop
1 parent 63b3088 commit 494ac5d

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

core/src/processing/core/PApplet.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8497,6 +8497,11 @@ public void rect(float a, float b, float c, float d,
84978497
}
84988498

84998499

8500+
public void square(float x, float y, float extent) {
8501+
g.square(x, y, extent);
8502+
}
8503+
8504+
85008505
public void ellipseMode(int mode) {
85018506
g.ellipseMode(mode);
85028507
}
@@ -8528,6 +8533,11 @@ public void arc(float a, float b, float c, float d,
85288533
}
85298534

85308535

8536+
public void circle(float x, float y, float extent) {
8537+
g.circle(x, y, extent);
8538+
}
8539+
8540+
85318541
public void box(float size) {
85328542
g.box(size);
85338543
}
@@ -8970,6 +8980,16 @@ public void text(float num, float x, float y, float z) {
89708980
}
89718981

89728982

8983+
public void push() {
8984+
g.push();
8985+
}
8986+
8987+
8988+
public void pop() {
8989+
g.pop();
8990+
}
8991+
8992+
89738993
/**
89748994
* Push a copy of the current transformation matrix onto the stack.
89758995
*/

core/src/processing/core/PGraphics.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,6 +2206,10 @@ protected void rectImpl(float x1, float y1, float x2, float y2,
22062206
}
22072207

22082208

2209+
public void square(float x, float y, float extent) {
2210+
rect(x, y, extent, extent);
2211+
}
2212+
22092213

22102214
//////////////////////////////////////////////////////////////
22112215

@@ -2325,6 +2329,10 @@ protected void arcImpl(float x, float y, float w, float h,
23252329
}
23262330

23272331

2332+
public void circle(float x, float y, float extent) {
2333+
ellipse(x, y, extent, extent);
2334+
}
2335+
23282336

23292337
//////////////////////////////////////////////////////////////
23302338

@@ -3861,6 +3869,22 @@ protected void textCharModelImpl(PImage glyph,
38613869
}
38623870

38633871

3872+
//////////////////////////////////////////////////////////////
3873+
3874+
// PARITY WITH P5.JS
3875+
3876+
3877+
public void push() {
3878+
pushStyle();
3879+
pushMatrix();
3880+
}
3881+
3882+
3883+
public void pop() {
3884+
popStyle();
3885+
popMatrix();
3886+
}
3887+
38643888

38653889
//////////////////////////////////////////////////////////////
38663890

0 commit comments

Comments
 (0)