# Too many calls to pushMatrix()

**URL:** <https://discourse.processing.org/t/too-many-calls-to-pushmatrix/23411>\
**Category:** Coding Questions\
**Created:** [August 21, 2020, 9:00am UTC](https://discourse.processing.org/t/too-many-calls-to-pushmatrix/23411 "2020-08-21T09:00:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 21, 2020, 9:05am UTC](https://discourse.processing.org/t/too-many-calls-to-pushmatrix/23411/2 "2020-08-21T09:05:02Z")

</div>

> [@todai](#):
>
> Is there a way to increase the matrix stack depth for pushMatrix()?

> [@pushMatrix() cannot use push more than 32 times](https://discourse.processing.org/t/pushmatrix-cannot-use-push-more-than-32-times/12860/5):
>
> /\*\* \* Change PGraphics Max Pushes (v1.0) \* GoToLoop (2019/Jul/21) \* \* https://Discourse.Processing.org/t/ \* pushmatrix-cannot-use-push-more-than-32-times/12860/5 \*/ import processing.awt.PGraphicsJava2D; import java.lang.reflect.Field; static final int PUSHES = 35, DIAM = 8, OFFSET\_Y = 15; void setup() { size(100, 550); noLoop(); fill(#FFFF00); stroke(#FF0000); setMaxPushes((PGraphicsJava2D) getGraphics(), PUSHES); } void draw() { clear(); for (int i = 0; i \< …

---

_[View the full topic](https://discourse.processing.org/t/too-many-calls-to-pushmatrix/23411)._
