Skip to content

Add style stack - #214

Open
tychedelia wants to merge 1 commit into
processing:mainfrom
tychedelia:style
Open

Add style stack#214
tychedelia wants to merge 1 commit into
processing:mainfrom
tychedelia:style

Conversation

@tychedelia

Copy link
Copy Markdown
Member

Adds the style stack, which works similarly to the existing transform stack and cleans up our RenderState struct that had been overflowing with style related options. Also adds the combo push/pop operations that also capture the transform state.

@tychedelia
tychedelia requested a review from catilac July 27, 2026 20:29
@SableRaf

SableRaf commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Thanks, @tychedelia!

I see this implements push()/pop() and pushStyle()/popStyle(). Does it also include pushMatrix()/popMatrix()?

This is one difference between Processing and p5.js: Processing includes three separate pairs of functions; pushMatrix()/popMatrix(), pushStyle()/popStyle(), and the general push()/pop() (which was added later and does both); while p5.js only includes the consolidated push()/pop() functions.

If it doesn't add too much complexity, I think it'd be good to include all three for backwards compatibility.

See: https://processing.org/reference/push_.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants