Skip to main content

push

Description

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. The push and pop functions can be embedded to provide more control.

push stores information related to the current transformation state and style settings controlled by the following functions: fill, noFill, noStroke, stroke, strokeWeight, rectMode, ellipseMode, colorMode, applyMatrix, resetMatrix, rotate, scale, translate.

Syntax

push()