diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 231e158bf..0c63c34de 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2013-15 The Processing Foundation + Copyright (c) 2013-19 The Processing Foundation Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology @@ -5164,13 +5164,75 @@ public class PGraphics extends PImage implements PConstants { // PARITY WITH P5.JS - + /** + * ( begin auto-generated from push.xml ) + * + * The push() function saves the current drawing style + * settings and transformations, while pop() restores these + * settings. Note that these functions are always used together. + * They allow you to change the style and transformation settings + * and later return to what you had. When a new state is started + * with push(), it builds on the current style and transform + * information.
+ *
+ * push() stores information related to the current + * transformation state and style settings controlled by the + * following functions: rotate(), translate(), + * scale(), fill(), stroke(), tint(), + * strokeWeight(), strokeCap(), strokeJoin(), + * imageMode(), rectMode(), ellipseMode(), + * colorMode(), textAlign(), textFont(), + * textMode(), textSize(), textLeading().
+ *
+ * The push() and pop() functions were added with + * Processing 3.5. They can be used in place of pushMatrix(), + * popMatrix(), pushStyles(), and popStyles(). + * The difference is that push() and pop() control both the + * transformations (rotate, scale, translate) and the drawing styles + * at the same time. + * + * ( end auto-generated ) + * + * @webref structure + * @see PGraphics#pop() + */ public void push() { pushStyle(); pushMatrix(); } - + /** + * ( begin auto-generated from pop.xml ) + * + * The pop() function restores the previous drawing style + * settings and transformations after push() has changed them. + * Note that these functions are always used together. They allow + * you to change the style and transformation settings and later + * return to what you had. When a new state is started with push(), + * it builds on the current style and transform information.
+ *
+ *
+ * push() stores information related to the current + * transformation state and style settings controlled by the + * following functions: rotate(), translate(), + * scale(), fill(), stroke(), tint(), + * strokeWeight(), strokeCap(), strokeJoin(), + * imageMode(), rectMode(), ellipseMode(), + * colorMode(), textAlign(), textFont(), + * textMode(), textSize(), textLeading().
+ *
+ * The push() and pop() functions were added with + * Processing 3.5. They can be used in place of pushMatrix(), + * popMatrix(), pushStyles(), and popStyles(). + * The difference is that push() and pop() control both the + * transformations (rotate, scale, translate) and the drawing styles + * at the same time. + * + * ( end auto-generated ) + * + * @webref structure + * @see PGraphics#push() + */ public void pop() { popStyle(); popMatrix();