Skip to content

Commit ba09591

Browse files
committed
PShape gets rect/ellipse mode from parent
1 parent 6598eb3 commit ba09591

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

core/src/processing/core/PShape.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,8 @@ public PShape(PGraphics g, int family) {
331331
// curveDetail = pg.curveDetail;
332332
// curveTightness = pg.curveTightness;
333333

334-
// The rect and ellipse modes are set to CORNER since it is the expected
335-
// mode for svg shapes.
336-
rectMode = CORNER;
337-
ellipseMode = CORNER;
334+
rectMode = g.rectMode;
335+
ellipseMode = g.ellipseMode;
338336

339337
// normalX = normalY = 0;
340338
// normalZ = 1;

core/src/processing/core/PShapeSVG.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ protected void setParent(PShapeSVG parent) {
266266

267267
opacity = parent.opacity;
268268
}
269+
270+
// The rect and ellipse modes are set to CORNER since it is the expected
271+
// mode for svg shapes.
272+
rectMode = CORNER;
273+
ellipseMode = CORNER;
269274
}
270275

271276

core/src/processing/opengl/PShapeOpenGL.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,8 @@ public PShapeOpenGL(PGraphicsOpenGL pg, int family) {
395395
curveDetail = pg.curveDetail;
396396
curveTightness = pg.curveTightness;
397397

398-
// The rect and ellipse modes are set to CORNER since it is the expected
399-
// mode for svg shapes.
400-
rectMode = CORNER;
401-
ellipseMode = CORNER;
398+
rectMode = pg.rectMode;
399+
ellipseMode = pg.ellipseMode;
402400

403401
normalX = normalY = 0;
404402
normalZ = 1;

0 commit comments

Comments
 (0)